loading screen while save operations happen
jrmcdona opened this issue · 1 comments
jrmcdona commented
Hello-
I am trying to figure out how to know when all of my Save operations have completed, so I can move to the next screen.
Right now we have about 5 save operations on start up.
Best practice for knowing when those have completed?
Thanks!
guns2410 commented
you could use load(store)
to achieve this
load(store)
.then((newState) => this.setState({ loading: false })) // set your state or flag here
.catch(() => console.log('Failed to load previous state'));
usually this could be in componentDidMount