@typescript-tea/core
Version:
The Elm Architecture for typescript
15 lines • 685 B
TypeScript
/**
* The dispatch function.
* @category Dispatch
*/
export declare type Dispatch<A> = (action: A) => void;
/**
* Maps a parent dispatch function to child dispatch function.
* The resulting function is memoized so it will be consistent
* for future calls. This makes it possible to avoid re-render in
* e.g. react becuase the dispach prop will not change like it
* would if a lambda like (a) => dispatch(mapper(a)) was used.
* @category Fancy Stuff
*/
export declare function map<ChildAction, ParentAction>(actionMapper: (childAction: ChildAction) => ParentAction, dispatch: Dispatch<ParentAction>): Dispatch<ChildAction>;
//# sourceMappingURL=dispatch.d.ts.map