Proper syntax for store.setState callback?
x8BitRain opened this issue · comments
What is the proper syntax for calling a function once the store has been updated? In React with setState you can do
this.setState({ thing: "thing" }, () => { console.log("thing was set!") })
But this doesn't appear to work the same way with store.setState(), I can also do
(async () => {
await store.setState({
thing: "thing"
});
console.log("thing set!")
})();
But I'm not sure if there's syntax that I don't know about that does the same without having to use async await.
Thanks!