Provides a third party extension point between dispatching an action and the moment it reaches the reducer.
1. Thunk Middleware -
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
4. Logger
Logs the previous state, action and the new state in the app whenever a new action is fired
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.
The list of reducers used in the app can be found here primero/app/javascript/reducer.js
- 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
- Handles Form Login state
Handles state when we are logged in
Handles Sorting in Tables (filter)