Commit e078ee44 authored by Nathan Faucett's avatar Nathan Faucett
Browse files

clean up

parent 80710df8
......@@ -94,17 +94,12 @@ class TodoList extends React.Component {
// update TodoList when todos or todoListForm emit an update
// on update adds todos state and todoListForm state to props
export default connect(
TodoList,
[todos, todoListForm],
// optional
(nextState, nextProps) => {
export default connect([todos, todoListForm], {
mapping: (nextState, nextProps, props) => {
// called on render should extract values from nextState to pass to component props
return nextState;
},
// optional
(prevState, nextState, props) => {
shouldUpdate: (prevState, nextState) => {
// called on update, if returns false cancels update
}
);
})(TodoList);
```
This diff is collapsed.
{
"name": "@nathanfaucett/state-react",
"version": "0.3.1",
"version": "0.3.2",
"description": "connect react components with state stores",
"repository": {
"type": "git",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment