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
Martha Sharpe edited this page Jan 26, 2021
·
2 revisions
This app uses a custom Redux middleware to make calls to the Grassp API.
The api.tsx file contains schemas for the different entities in state. It also defines the callApi function which handles each fetch request to the API.
It uses normalizr to normalize the JSON from the API response according to the schema. This makes every API response have the same shape, regardless of how nested the data is.
The index.tsx contains the rootReducer which combines the Redux formReducer and the api reducer.
The reducers use lodash as a utility to merge the API response with the Redux state.
The apiReducer calls the entitiesReducer for each action which requires a call to the Grassp API.