{"action":"created","issue":{"url":"https://api.github.com/repos/goatslacker/alt/issues/319","labels_url":"https://api.github.com/repos/goatslacker/alt/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/goatslacker/alt/issues/319/comments","events_url":"https://api.github.com/repos/goatslacker/alt/issues/319/events","html_url":"https://github.com/goatslacker/alt/issues/319","id":86900127,"number":319,"title":"Change is emitted after Store's action handler even when state is not changed","user":{"login":"endragor","id":2417849,"avatar_url":"https://avatars.githubusercontent.com/u/2417849?v=3","gravatar_id":"","url":"https://api.github.com/users/endragor","html_url":"https://github.com/endragor","followers_url":"https://api.github.com/users/endragor/followers","following_url":"https://api.github.com/users/endragor/following{/other_user}","gists_url":"https://api.github.com/users/endragor/gists{/gist_id}","starred_url":"https://api.github.com/users/endragor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endragor/subscriptions","organizations_url":"https://api.github.com/users/endragor/orgs","repos_url":"https://api.github.com/users/endragor/repos","events_url":"https://api.github.com/users/endragor/events{/privacy}","received_events_url":"https://api.github.com/users/endragor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-10T09:17:19Z","updated_at":"2015-06-10T17:51:24Z","closed_at":null,"body":"It looks like alt code emits change event from Stores even when nothing was actually changed, i.e. when `setState` was not even called in the handler. I wonder what's the reason behind such behaviour, if it's intended (it seems that it is, looking at the code).\r\nI have cases when `setState` might not be called from the action handler under certain circumstances. Besides, `setState` might be called to set a primitive value (boolean, number or string) that already has the same value (for example, boolean flag was already set to `true`). To prevent this, I have to manually insert `this.preventDefault()` and manually check whether my `setState()` is actually going to change something to save performance. I would love if the framework did it for me. I know it might be not reasonable to always compare the whole new state and old state, but just comparing the primitive values would already cover many cases, in my opinion."},"comment":{"url":"https://api.github.com/repos/goatslacker/alt/issues/comments/110851629","html_url":"https://github.com/goatslacker/alt/issues/319#issuecomment-110851629","issue_url":"https://api.github.com/repos/goatslacker/alt/issues/319","id":110851629,"user":{"login":"jdlehman","id":3144695,"avatar_url":"https://avatars.githubusercontent.com/u/3144695?v=3","gravatar_id":"","url":"https://api.github.com/users/jdlehman","html_url":"https://github.com/jdlehman","followers_url":"https://api.github.com/users/jdlehman/followers","following_url":"https://api.github.com/users/jdlehman/following{/other_user}","gists_url":"https://api.github.com/users/jdlehman/gists{/gist_id}","starred_url":"https://api.github.com/users/jdlehman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdlehman/subscriptions","organizations_url":"https://api.github.com/users/jdlehman/orgs","repos_url":"https://api.github.com/users/jdlehman/repos","events_url":"https://api.github.com/users/jdlehman/events{/privacy}","received_events_url":"https://api.github.com/users/jdlehman/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T17:51:24Z","updated_at":"2015-06-10T17:51:24Z","body":"I don't see why not, we generally like providing the ability to configure.\r\n\r\nA good place to do something like this would be in the [store config](https://github.com/goatslacker/alt/blob/master/docs/createStore.md#storemodelconfig).  Feel free to submit a PR otherwise I will try to take a look at it today or tomorrow and try to get something working."}}