| 1169 | } |
| 1170 | |
| 1171 | const makeFn = <Arg, E, A>( |
| 1172 | f: (arg: Arg, get: FnContext) => Stream.Stream<A, E, AtomRegistry> | Effect.Effect<A, E, Scope.Scope | AtomRegistry>, |
| 1173 | options?: { |
| 1174 | readonly initialValue?: A | undefined |
| 1175 | readonly concurrent?: boolean | undefined |
| 1176 | } |
| 1177 | ): AtomResultFn<Arg, A, E | Cause.NoSuchElementError> => { |
| 1178 | const [read, write] = makeResultFn(f, options) |
| 1179 | return writable(read, write) as any |
| 1180 | } |
| 1181 | |
| 1182 | function makeResultFn<Arg, E, A>( |
| 1183 | f: (arg: Arg, get: FnContext) => Effect.Effect<A, E, Scope.Scope | AtomRegistry> | Stream.Stream<A, E, AtomRegistry>, |