Open srcspider opened 8 years ago
While I've basically never used it actions used bind to set the tree as this, this no longer happens with dispatch. I'm curious as to if there is any reason for this change?
The reasons are the following:
I used to use async actions as
this.props.actions.sendMessage(text)
.then((res) => this.setState({ sendingMessage: false }));
I guess this will force me to send all the state to the tree instead of leaving some state in the components
It's a bit strange to have a component with mixed local & external state but I see your point. Maybe I can make the dispatch
function return the result of you action so you can access your Promise.
Allow @srcspider. I haven't had time to write such a guide, but the differences are quite few: Just know that the higher-order function has seen its arguments swapped, that you don't have to provide an object with the
cursors
andactions
key, but just the cursors and that adispatch
props is passed to the component as a mean to dispatch the actions.