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