{"push_id":563442602,"size":1,"distinct_size":1,"ref":"refs/heads/features/bkt-dispatcher-batching-function","head":"f6101c233d013a7657ed876ce1ced0e0cec65c36","before":"fa3ca9fd3cba259a4e3d75bbf3549ee9dd9c381b","commits":[{"sha":"f6101c233d013a7657ed876ce1ced0e0cec65c36","author":{"email":"ef971ee38bba25d9ac8a840d235457a038448b09@brandontilley.com","name":"Brandon Tilley"},"message":"Allow injection of a batching function to wrap dispatches\n\nReact automatically batches updates when inside a synthetic event\nhandler, but asynchronous updates do not get the same treatment.\nConsider the following scenario:\n\n1. A button in ComponentA calls an action creator\n2. The action creator calls an async API\n3. As a result of the async call, the action creator dispatches an action\n4. That action sets new state in a store\n5. The new store data causes a new child to be mounted inside ComponentA\n   (let's call it ComponentB)\n6. ComponentB fires an action immediately, via componentDid/WillMount\n\nUnlike re-renders from synchronous action dispatches (which generally\nhappen in the context of a synthetic event), asynchronous dispatches\naren't called within the context of React's batching strategy. This means\nthe dispatch loop is still in progress when ComponentB mounts, causing\na cascading dispatch exception.\n\n`Flux#setBatchingFunction` allows you to pass a batching function to\nwrap dispatches in; in most (all?) cases, you'll want to pass\n`React.addons.batchedUpdates` in order to force all dispatches to happen\nin the context of React's batched updates.\n\nFixes #92","distinct":true,"url":"https://api.github.com/repos/BinaryMuse/fluxxor/commits/f6101c233d013a7657ed876ce1ced0e0cec65c36"}]}