• A decorator function that generates an action creator for a specific function.

    Example

    export class RoutesReducer extends AbstractReducer {

    // optional static var to allow to add type's for auto-complete
    // ActionPayload< payload interface / state >
    static override actions: ActionPayload<RoutesReducer>;

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

    public isLogin() {
    this.ngRedux.dispatch(
    RoutesReducer.actions.isLogin()
    );
    }

    Parameters

    • target: any

      The target object on which to apply the decorator.

    • functionName: string

      The name of the function to create the action for.

    Returns void

Generated using TypeDoc