UNPKG

mst-effect

Version:

Designed to be used with MobX-State-Tree to create asynchronous actions using RxJS.

7 lines 499 B
import { Observable } from 'rxjs'; import type { PayloadFunc, AnyInstance, NormalizeOptionalPayload } from '../types'; import type { ValidEffectActions } from './action'; export declare type EffectFactory<P> = (payload$: Observable<NormalizeOptionalPayload<P>>) => Observable<ValidEffectActions>; export declare type EffectDispatcher<P> = PayloadFunc<P, void>; export declare function effect<P>(self: AnyInstance, factory: EffectFactory<P>): EffectDispatcher<P>; //# sourceMappingURL=effect.d.ts.map