• A decorator function that modifies the behavior of any @Select, @Select$, or @Dispatch decorators to operate on a substore defined with a given reducer.

    Example

    @SubStore(userComponentReducer)
    export class TestComponent implements OnInit {
    @Input() userId: String;

    // The substore will be created from the return value of this function.
    basePath(): Array<string | String> | null {
    return this.userId ? ['users', this.userId] : null;
    }
    }

    Returns

    A ClassDecorator function that sets the reducer to the class constructor's LOCAL_REDUCER_KEY property.

    Parameters

    • reducer: Reducer<any, AnyAction>

      The reducer function used to create the substore.

    Returns ClassDecorator

Generated using TypeDoc