UNPKG

ngrx-immer

Version:

Immer wrappers around NgRx methods createReducer, on, and ComponentStore

15 lines (14 loc) 913 B
import { Observable, Subscription } from 'rxjs'; import { ComponentStore } from '@ngrx/component-store'; import * as i0 from "@angular/core"; /** * Immer wrapper around `ImmerComponentStore` to mutate state * with `updater` and `setState` */ export declare class ImmerComponentStore<State extends object> extends ComponentStore<State> { constructor(defaultState?: State); updater<ProvidedType = void, OriginType = ProvidedType, ValueType = OriginType, ReturnType = OriginType extends void ? () => void : (observableOrValue: ValueType | Observable<ValueType>) => Subscription>(updaterFn: (state: State, value: OriginType) => void | State): ReturnType; setState(stateOrUpdaterFn: State | ((state: State) => void | State)): void; static ɵfac: i0.ɵɵFactoryDeclaration<ImmerComponentStore<any>, [{ optional: true; }]>; static ɵprov: i0.ɵɵInjectableDeclaration<ImmerComponentStore<any>>; }