Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IRootReducer<TState, TReducerState>

Type parameters

  • TState

  • TReducerState

Hierarchy

Index

Properties

name

name: string

Unique name that uses as key for state

path

path: string

Dot separated path string to current ISubReducer

reducer

reducer: Reducer<TReducerState>

Reducer function. Can be used as classic Reducer

Methods

join

  • join<T>(reducer: ISubReducer<TReducerState, T>): this
  • Join ISubReducer to another. If ISubReducer with same name already joined, it will be unjoined before joining new.

    Type parameters

    • T: TReducerState[keyof TReducerState]

    Parameters

    Returns this

    this

joinListener

  • Join ActionsHandler to reducer, that listen all actions. If listener with same name already joined, it will be unjoined before joining new.

    Parameters

    • name: string

      Key for listener

    • handler: ActionsHandler<TState>

      Function that accpets action & state as params

    Returns this

    this

joinReducer

  • joinReducer<T>(name: keyof TReducerState, reducer: function): this
  • Join reducer to subreducer. If reducer with same name already joined, it will be unjoined before joining new.

    Type parameters

    • T: TReducerState[keyof TReducerState]

    Parameters

    • name: keyof TReducerState

      That argument is key in state object. Same as ISubReducer.name

    • reducer: function

      Reducer function

        • (state: T, action: any): T
        • Parameters

          • state: T
          • action: any

          Returns T

    Returns this

    this

on

  • Set reducer for action, you cant set only one reducer per action.

    Type parameters

    • TPayload

    Parameters

    • action: IExtendAction<TPayload>

      Any redux action, or action created with [[action.createAction()]] or [[action.createPayloadAction()]]

    • reducer: ActionReducer<TReducerState, TPayload>

      Function that accepts state and payload (if action have) arguments, must return object to update state immutable.

    Returns this

    this

  • Set reducer for actions, you cant set only one reducer per action.

    Type parameters

    • TPayload

    Parameters

    • actions: Array<IExtendAction<TPayload>>

      Array of any redux actions, or actions created with [[action.createAction()]] or [[action.createPayloadAction()]]

    • reducer: ActionReducer<TReducerState, TPayload>

      Function that accepts state and payload (if action have) arguments, must return object to update state immutable.

    Returns this

    this

  • Type parameters

    • TPayload

    Parameters

    Returns this

Generated using TypeDoc