I'm trying to use the code from docs but the code to update state in initializeState doesn't work with promises.
<RecoilRoot
initializeState={({ set }) => {
// this line update the count atom
// set({ key: "count" }, 100);
// but in promise it doesn't work:
Promise.all([1]).then(() => {
set({ key: "count" }, 100);
});
}}
>
<App />
</RecoilRoot>
Here the demo: https://codesandbox.io/s/strange-wescoff-pwvih?file=/src/index.js
Hi @polemius. I believe this is a duplicate of either #103 or #171
@polemius - The persistence API is currently under development and will change, working on it now.. The initializeState callback doesn't support async sets. Removing that from the docs. (#209) I should probably remove those docs entirely until the API is published..
@acutmore @drarmstr Thanks 馃憤