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