KELiON / redux-async-initial-state

Redux middleware that helps you load redux initial state asynchronously
MIT License
114 stars 12 forks source link

Initial state not loaded immediately #20

Open olivierpascal opened 6 years ago

olivierpascal commented 6 years ago

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 commented 5 years ago

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

ruckk commented 4 years ago

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 commented 4 years ago

Same problem here.

Nobody fix it yet?

MaximKalinin commented 2 years ago

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'} });