javascript - Initialise redux state from uri -


i wish initialise state (list) api endpoint.

what's best way of doing this? example, supply starting state reducer, or starting state in reducer empty , somehow have action new state?

i considered using redux-thunk sort of thing, simple example of how above great.

let startstate = {};  //some form of url fetch here or supply data through action?  const reducer = (state = startstate, action) => {     ... } 


Comments

Popular posts from this blog

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

javascript - Create a stacked percentage column -