{"action":"opened","issue":{"url":"https://api.github.com/repos/mobxjs/mobx/issues/1639","repository_url":"https://api.github.com/repos/mobxjs/mobx","labels_url":"https://api.github.com/repos/mobxjs/mobx/issues/1639/labels{/name}","comments_url":"https://api.github.com/repos/mobxjs/mobx/issues/1639/comments","events_url":"https://api.github.com/repos/mobxjs/mobx/issues/1639/events","html_url":"https://github.com/mobxjs/mobx/issues/1639","id":340712483,"node_id":"MDU6SXNzdWUzNDA3MTI0ODM=","number":1639,"title":"Store should be immutable","user":{"login":"nir2002","id":7668820,"node_id":"MDQ6VXNlcjc2Njg4MjA=","avatar_url":"https://avatars0.githubusercontent.com/u/7668820?v=4","gravatar_id":"","url":"https://api.github.com/users/nir2002","html_url":"https://github.com/nir2002","followers_url":"https://api.github.com/users/nir2002/followers","following_url":"https://api.github.com/users/nir2002/following{/other_user}","gists_url":"https://api.github.com/users/nir2002/gists{/gist_id}","starred_url":"https://api.github.com/users/nir2002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nir2002/subscriptions","organizations_url":"https://api.github.com/users/nir2002/orgs","repos_url":"https://api.github.com/users/nir2002/repos","events_url":"https://api.github.com/users/nir2002/events{/privacy}","received_events_url":"https://api.github.com/users/nir2002/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-12T16:33:30Z","updated_at":"2018-07-12T16:33:30Z","closed_at":null,"author_association":"NONE","body":"I recently encountered a problem by a programming mistake which I believe we can protect others from redoing.\r\n\r\nI set up an action in my store which purpose was to set a store value.\r\n\r\nThen, after I injected the store to my (React) component i was using the action as an assignment instead of a function: (\"store.action = value;\" insted of -> \"store.action(value)\")\r\n\r\nThat cause the action to change from function to the value and be no longer valid as an action.\r\n\r\nI think we can use the configuration object of mobx and set the store to immutable to prevent issues like that from happening.\r\nThis can go hand by hand with the \"enforceActions\" configurations.\r\n\r\n"}}
{"actor":{"display_login":"nir2002"}}