{"action":"created","issue":{"url":"https://api.github.com/repos/gaearon/redux/issues/46","labels_url":"https://api.github.com/repos/gaearon/redux/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/gaearon/redux/issues/46/comments","events_url":"https://api.github.com/repos/gaearon/redux/issues/46/events","html_url":"https://github.com/gaearon/redux/pull/46","id":85731609,"number":46,"title":"Feeback wanted: Rewrite with ideas from @acdlite","user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":32,"created_at":"2015-06-06T09:56:42Z","updated_at":"2015-06-06T16:29:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/gaearon/redux/pulls/46","html_url":"https://github.com/gaearon/redux/pull/46","diff_url":"https://github.com/gaearon/redux/pull/46.diff","patch_url":"https://github.com/gaearon/redux/pull/46.patch"},"body":"So @acdlite got me a birthday present (yay it's my birthday today :-): [this gist](https://gist.github.com/acdlite/9f1b5883d132ad242323).\r\n\r\nIt shows how much easier Redux can be implemented if we embrace single-atomness and instead of hiding it, *make it explicit*.\r\n\r\nI changed a few things from his implementation:\r\n\r\n* Instead of pushing `atom` down the `context`, I push `subscribe()` to avoid [shouldComponentUpdate problems](https://github.com/facebook/react/issues/2517);\r\n* Instead of relying on `setState`, maintain `this.atom` in Dispatcher so `setState` is called both on the root and the children at the same time and the atom is never stale in the action creators;\r\n* Add a convenience `combineStores` higher-order store (lol) that converts an object map of Stores into a Store function that combines them.\r\n\r\nI combined our two examples to better show how this works together.\r\nI like it.\r\n\r\nWould love to hear your thoughts.\r\n\r\n@acdlite @ooflorent @threepointone @vslinko \r\n\r\n## TODO\r\n\r\n- [x] Initial implementation of Store composition\r\n- [x] Performance work\r\n- [x] Extract dispatcher for non-React use, make it part of public API\r\n- [x] Figure out the API for dispatching actions (#45, #48)\r\n- [ ] Support isomorphic apps @acdlite \r\n- [ ] Update README"},"comment":{"url":"https://api.github.com/repos/gaearon/redux/issues/comments/109614105","html_url":"https://github.com/gaearon/redux/pull/46#issuecomment-109614105","issue_url":"https://api.github.com/repos/gaearon/redux/issues/46","id":109614105,"user":{"login":"acdlite","id":3624098,"avatar_url":"https://avatars.githubusercontent.com/u/3624098?v=3","gravatar_id":"","url":"https://api.github.com/users/acdlite","html_url":"https://github.com/acdlite","followers_url":"https://api.github.com/users/acdlite/followers","following_url":"https://api.github.com/users/acdlite/following{/other_user}","gists_url":"https://api.github.com/users/acdlite/gists{/gist_id}","starred_url":"https://api.github.com/users/acdlite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acdlite/subscriptions","organizations_url":"https://api.github.com/users/acdlite/orgs","repos_url":"https://api.github.com/users/acdlite/repos","events_url":"https://api.github.com/users/acdlite/events{/privacy}","received_events_url":"https://api.github.com/users/acdlite/received_events","type":"User","site_admin":false},"created_at":"2015-06-06T16:29:18Z","updated_at":"2015-06-06T16:29:18Z","body":"Also, my perspective is admittedly a bit skewed because in my gist, literally the only stateful part is the atom, whereas Redux also keeps track of subscriptions (for good reasons) and needs to provide a direct interface for dehydration, etc."}}