redux-async-initial-state
redux-async-initial-state copied to clipboard
Initial state not loaded immediately
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?
@olivierpascal, use redux^3.7.2 and redux-async-initial-state^0.2.2
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.
Same problem here.
Nobody fix it yet?
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'} });