You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if you have an asynchronous action, you are in charge of calling store.setState manually, while synchronous actions can just return the state update, and setState is called after the return. What if actions could return Promises and setState was called after the Promise resolves? Something like this:
// ActionasyncincrementAsync(state){constresponse=awaitfetch("data.json");constdata=awaitresponse.json();return{ data };}// Mapped action// https://github.com/developit/unistore/blob/master/unistore.js#L78Promise.resolve(actions[i](store.getState(), ...args)).then(store.setState);
The text was updated successfully, but these errors were encountered:
Currently, if you have an asynchronous action, you are in charge of calling
store.setState
manually, while synchronous actions can just return the state update, and setState is called after the return. What if actions could return Promises and setState was called after the Promise resolves? Something like this:The text was updated successfully, but these errors were encountered: