(this: Lifetime<any>, atom: Atom.Atom<Result.AsyncResult<A, E>>, options?: {
readonly suspendOnWaiting?: boolean | undefined
})
| 873 | }, |
| 874 | |
| 875 | result<A, E>(this: Lifetime<any>, atom: Atom.Atom<Result.AsyncResult<A, E>>, options?: { |
| 876 | readonly suspendOnWaiting?: boolean | undefined |
| 877 | }): Effect.Effect<A, E> { |
| 878 | if (this.disposed || this.isFn) { |
| 879 | return this.resultOnce(atom, options) |
| 880 | } |
| 881 | const result = this.get(atom) |
| 882 | if (options?.suspendOnWaiting && result.waiting) { |
| 883 | return Effect.never |
| 884 | } |
| 885 | switch (result._tag) { |
| 886 | case "Initial": { |
| 887 | return Effect.never |
| 888 | } |
| 889 | case "Failure": { |
| 890 | return Exit.failCause(result.cause) |
| 891 | } |
| 892 | case "Success": { |
| 893 | return Effect.succeed(result.value) |
| 894 | } |
| 895 | } |
| 896 | }, |
| 897 | |
| 898 | resultOnce<A, E>(this: Lifetime<any>, atom: Atom.Atom<Result.AsyncResult<A, E>>, options?: { |
| 899 | readonly suspendOnWaiting?: boolean | undefined |
no test coverage detected