UNPKG

atombeak

Version:

Create asynchronous atomic functions!

19 lines (18 loc) 773 B
import { Log } from "./Log"; export declare const GOOD = "GOOD"; export declare type Good<Outer, Inner, Action> = { type: 'GOOD'; value: Inner; log: Log<Outer, Action>; }; export declare function good<Outer, Inner, Action>(value: Inner, log: Log<Outer, Action>): Good<Outer, Inner, Action>; export declare const RETRY = "RETRY"; export declare type Retry<Outer, Action> = { type: 'RETRY'; log: Log<Outer, Action>; }; export declare function retry<Outer, Action>(log: Log<Outer, Action>): Retry<Outer, Action>; export declare type Result<Outer, Inner, Action> = Good<Outer, Inner, Action> | Retry<Outer, Action>; export declare const Result: { map<Outer, A, B, Action>(result: Result<Outer, A, Action>, fn: (a: A) => B): Result<Outer, B, Action>; };