Skip to content

Redux ‐ How to Implement

roux g. buciu edited this page Sep 6, 2024 · 16 revisions

How to Add Redux to a new place

Introduction

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.

Process Overview

To add a new Redux component, you'll need to do the following things:

  1. Create an action
  2. Create a state
  3. Create a middleware (this is optional, depending on what you're implementing)
  4. Add the required connections to turn your component into a fully operational battleship

Below, you'll find templates for the work that needs doing.

Actions

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
}

States

Connections

Middlewares (Optional)

Clone this wiki locally