-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Redux ‐ How to Implement
roux g. buciu edited this page Sep 6, 2024
·
16 revisions
So you want to add a Redux action and are unsure of what to do. Well, you've come to the right place! For a more comprehensive discussion of Redux in our application, take a look at this bad boy. This page will only be concerned with the nitty gritty details of how to become the greatest Redux-master the world has every known... for your particular feature.
To add a new Redux component, you'll need to do the following things:
- Create an action
- Create a state
- Create a middleware (this is optional, depending on what you're implementing)
- Add the required connections to turn your component into a fully operational battleship
Below, you'll find templates for the work that needs doing.
The action
final class ExampleAction: Action {
override init(windowUUID: WindowUUID, actionType: any ActionType) {
super.init(windowUUID: windowUUID, actionType: actionType)
}
}
enum ExampleActionType: ActionType {
case respond to an action
}