UNPKG

@rxx/core

Version:

React MVI micro framework.

11 lines (10 loc) 645 B
import { Observable } from 'rxjs'; import { FlatScanOptions, FlatScanReturnType } from './observable/flatscan'; import { SubjectPayload } from './subject'; declare type ReducerReturnType<T> = FlatScanReturnType<T>; export declare enum SystemEvent { REPLACE_STATE = "@System::replace-state" } export declare type ReducerOptions<T> = FlatScanOptions<T>; export declare function reducer<T extends SubjectPayload<string, any, any>, U>(source: Observable<T>, handler: (state: U, payload: T) => ReducerReturnType<U> | Promise<ReducerReturnType<U>>, initial?: U | Observable<U> | Promise<U>, options?: ReducerOptions<T>): Observable<U>; export {};