diff --git a/packages/effect-fc/src/Result.ts b/packages/effect-fc/src/Result.ts index f065082..4ddda52 100644 --- a/packages/effect-fc/src/Result.ts +++ b/packages/effect-fc/src/Result.ts @@ -29,7 +29,7 @@ export interface Initial extends Result.Prototype { export interface Running
extends Result.Prototype { readonly _tag: "Running" - readonly progress: P + readonly progress: Option.Option
}
export interface Success extends Result.Prototype {
@@ -45,7 +45,7 @@ export interface Failure extends Result.Prototype {
export interface Refreshing {
readonly refreshing: true
- readonly progress: P
+ readonly progress: Option.Option
}
@@ -96,7 +96,7 @@ const ResultPrototype = Object.freeze({
export interface ProgressService {
- readonly update: (progress: P) => Effect.Effect ) => Option.Option ) => Effect.Effect (progress?: P): Running => Object.setPrototypeOf({ _tag: "Running", progress }, ResultPrototype)
+export const running = (progress?: P): Running => Object.setPrototypeOf({
+ _tag: "Running",
+ progress: Option.fromNullable(progress),
+}, ResultPrototype)
export const succeed = (value: A): Success => Object.setPrototypeOf({ _tag: "Success", value }, ResultPrototype)
export const fail = => Object.setPrototypeOf(
- Object.assign({}, result, { progress }),
+ Object.assign({}, result, { progress: Option.fromNullable(progress) }),
Object.getPrototypeOf(result),
)
@@ -146,9 +149,9 @@ export const toExit = (
}
}
-export const forkEffectScoped = (
- effect: Effect.Effect
-): Effect.Effect