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
Post a Comment