You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of our app state is kept in a global Redux store. Components subscribe to the store to get state, and dispatch actions to the store to set state. They also dispatch async actions, which orchestrate API calls, actions, and even other async actions.
Ideally, components would keep their own view state, make their own API calls, and allow the React scheduler to orchestrate. Hooks make this possible; the goals of this effort are to figure out how to accomplish it, evaluate the ergonomics, and determine how to move forward.
We attempted to utilize useReducer and context instead of redux but found it too troublesome when it came down to orchestrating asynchronous actions between components at different locations in the app. For now we are just going to move Redux to peregrine along with the actions, stores, and other related code (venia-ui depends on peregrine, not the other way around).
Most of our app state is kept in a global Redux store. Components subscribe to the store to get state, and dispatch actions to the store to set state. They also dispatch async actions, which orchestrate API calls, actions, and even other async actions.
Ideally, components would keep their own view state, make their own API calls, and allow the React scheduler to orchestrate. Hooks make this possible; the goals of this effort are to figure out how to accomplish it, evaluate the ergonomics, and determine how to move forward.
See spike #1483 for code.
Will update issue with findings.
The text was updated successfully, but these errors were encountered: