Function
promise
(evaluate: (signal: AbortSignal) => PromiseLike<A>)
Source from the content-addressed store, hash-verified
| 1061 | * @category constructors |
| 1062 | */ |
| 1063 | export const promise = <A>(evaluate: (signal: AbortSignal) => PromiseLike<A>): Micro<A> => |
| 1064 | asyncOptions<A>(function(resume, signal) { |
| 1065 | evaluate(signal!).then( |
| 1066 | (a) => resume(succeed(a)), |
| 1067 | (e) => resume(die(e)) |
| 1068 | ) |
| 1069 | }, evaluate.length !== 0) |
| 1070 | |
| 1071 | /** |
| 1072 | * Wrap a `Promise` into a `Micro` effect. Any errors will be caught and |
Callers
nothing calls this directly
Tested by
no test coverage detected