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

Initial state not loaded immediately #20

Open
olivierpascal opened this issue Oct 11, 2018 · 4 comments
Open

Initial state not loaded immediately #20

olivierpascal opened this issue Oct 11, 2018 · 4 comments

Comments

@olivierpascal
Copy link

I currently use store.dispatch({ type: '' }); just after createStore() as a workaround to make STATE_LOADING_START dispatched asap but it's quite ugly. Is it the expected way to do this?

@oleksii-b
Copy link

@olivierpascal, use redux^3.7.2 and redux-async-initial-state^0.2.2

@ruckk
Copy link

ruckk commented Feb 16, 2020

Any update on this? I had the same problem and adding store.dispatch({ type: '' }); fixed the problem but i don't like it. I use redux 4.0.5 and redux-async-initial-state 0.3.0.

@josegoval
Copy link

Same problem here.

Nobody fix it yet?

@MaximKalinin
Copy link

I also faced the problem. Apart from what have been said, I can add that using more meaningful action type (for example, 'START-REDUX-ASYNC-INITIAL-STATE') can help understand the intention later:

store.dispatch({ type: 'START-REDUX-ASYNC-INITIAL-STATE' });

Also, if you are using electron-redux, you can add meta: {scope: 'local'} to not flood main process:

store.dispatch({ type: 'START-REDUX-ASYNC-INITIAL-STATE', meta: {scope: 'local'} });

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

5 participants