{"action":"opened","issue":{"url":"https://api.github.com/repos/zetachang/react.rb/issues/21","labels_url":"https://api.github.com/repos/zetachang/react.rb/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/zetachang/react.rb/issues/21/comments","events_url":"https://api.github.com/repos/zetachang/react.rb/issues/21/events","html_url":"https://github.com/zetachang/react.rb/issues/21","id":71661947,"number":21,"title":"change define_state ","user":{"login":"catmando","id":63146,"avatar_url":"https://avatars.githubusercontent.com/u/63146?v=3","gravatar_id":"","url":"https://api.github.com/users/catmando","html_url":"https://github.com/catmando","followers_url":"https://api.github.com/users/catmando/followers","following_url":"https://api.github.com/users/catmando/following{/other_user}","gists_url":"https://api.github.com/users/catmando/gists{/gist_id}","starred_url":"https://api.github.com/users/catmando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catmando/subscriptions","organizations_url":"https://api.github.com/users/catmando/orgs","repos_url":"https://api.github.com/users/catmando/repos","events_url":"https://api.github.com/users/catmando/events{/privacy}","received_events_url":"https://api.github.com/users/catmando/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-28T18:11:07Z","updated_at":"2015-04-28T18:11:07Z","closed_at":null,"body":"I propose changing define_state to work like this:\r\n\r\ndefine_state do |v1, v2, v3|\r\n  v1 = \"initial value\"\r\n  v2 = \"some other initial value\"\r\n  # v3 never gets initialized\r\nend\r\n\r\nYou can also do \r\n\r\ndefine_state do |v1 = \"foo\", v2 = \"bar\"| end\r\n\r\nwhich is very nice too.\r\n\r\nThis is possible after ruby 1.9 because you can get the list of parameter names for the block.\r\n\r\nThis syntax will work only if there are NO define_state parameter... i.e. define_state(:x) will continue to work as it does today.\r\n\r\nI will be happy to implement this and do a pull request, I just want some feedback that this will be acceptable."}}