Class AbstractReducerAbstract

Hierarchy

  • AbstractReducer

Constructors

Properties

Methods

Constructors

Properties

actions: {
    [key: string]: ActionCreator<any>;
} = {}

Hold a map of all dispatch action that generated by decorator

Example

class Reducer extends AbstractReducer {
// optional static var to allow to add type's for auto-complete
// ActionPayload< payload interface / state >
static override actions: ActionPayload<Reducer>;
}

Type declaration

Methods

  • Creates a Redux reducer based on the methods of the instantiated class.

    Example

    class Reducer extends AbstractReducer {

    // optional static var to allow adding type for auto-complete
    // ActionPayload< payload interface / state >
    static override actions: ActionPayload<Reducer>;

    @Action
    deleteBug(state: Auth, action: AnyAction) {
    return { active_bug: !state.active_bug };
    }
    }

    export const authReducer = Reducer.createReducer(BUG_INITIAL_STATE);

    Returns

    A Redux reducer that can be used with createStore.

    Type Parameters

    • State = any

    Parameters

    • this: (new () => any)

      The class constructor.

        • new (): any
        • Returns any

    • initialState: any

      The initial state for the reducer.

    Returns Reducer<State>

Generated using TypeDoc