Predictable state container for JavaScript apps
4 Jun 2015 · Newest first
Last checked
Checking sources…
Showing 1 of 1 releases. Full release notes.
Signals highlight changes worth reviewing. They cannot determine whether your application is affected.
0.5.1 → 0.6.0
Breaking change:
storesnow accepts an object, just likeactions
stores now accepts an object, just like actionsContainer children function signature is now ({ actions, state }) => ...Container props validationThis fixes #22. There is no more prop shape difference between subscribing to a single or to many stores. Your container may now look like this:
<Container stores={{ counter: stores.counterStore }}
actions={{ increment, decrement }}>
{({ state, actions }) => <Counter {...state} {...actions} />}
</Container>
Note that you can change the state shape by giving arbitrary keys to your stores. It's also easier to choose what exactly you want to pass to the component. For example, you could write actions={actions} instead of {...actions}, and get all actions in this.props.actions.
The decorator version is changed the same way:
@container({
actions: { increment, decrement },
stores: { counter: counterStore }
})
export default class Counter {
It also now accepts a second transformProps argument to be just as expressive as the component version:
@container({
actions: { increment, decrement },
stores: { counter: counterStore }
}, ({ actions, state}) => { ...actions, ...state })) // default shape; you can write your own