Provides a third party extension point between dispatching an action and the moment it reaches the reducer.
In Primero V2, we have used the following Middlewares:
Thunk middleware allows you to write action creators that return a function instead of an action. The thunk can be used to delay the dispatch of an action, or to dispatch only if a certain condition is met.
Keeps the location of router in sync with redux
Developer Tools to power-up Redux development workflow or any other architecture which handles the state change
Logs the previous state, action and the new state in the app whenever a new action is fired
We also have Three Custom middleware
Redux provides with API called applyMiddleware which allows us to use custom middleware
- Rest Middleware decides if Data fetched from API has been cached or not.
- Offline caching of redux store
- Ensures user is authenticated before accessing the app
Reducers specify how the application's state changes in response to actions sent to the store.
- System Settings and Network Status handling
- Switching language in the app
- On change in Nav, it changes the api path
- handles state related to the notification bar like adding, closing and removing a snackbar.
- Handles Dashboard data loading - Success, failure and loading state
- Handles Export Lists
8. loginFormReducer -
- Handles Form Login state
9. loginReducer -
Handles state when we are logged in
10. recordActionsReducer -
Handles Sorting in Tables (filter)