Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: async processing of each state upgrade #13

Open
guopengliang opened this issue Mar 29, 2017 · 1 comment
Open

Feature request: async processing of each state upgrade #13

guopengliang opened this issue Mar 29, 2017 · 1 comment

Comments

@guopengliang
Copy link

First of all, thank you for maintaining this library.

It would be more powerful if we could do async updates. In real cases, it is often complicated to upgrade/migrate database. Say we need to inject data loaded from another asyncStorage.

const manifest = {
    1: (state) => new Promise((resolve) => {
        // manipulate state object ...
        resolve(state);
    }),
    2: (state) => new Promise((resolve) => {
        // manipulate state object ...
        resolve(state);
    })
};
@rt2zz
Copy link
Contributor

rt2zz commented Apr 4, 2017

This seems like a sensible api, also async await would make the conversion to support Promises or plain return values trivial. Will gladly accept PR 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants