import { Effect, Fiber, Option, type Ref, type SubscriptionRef } from "effect" import * as AsyncData from "@typed/async-data" export interface QueryRunner { readonly stateRef: SubscriptionRef.SubscriptionRef> readonly fiberRef: SubscriptionRef.SubscriptionRef>> readonly interrupt: Effect.Effect readonly fetch: Effect.Effect readonly refetch: Effect.Effect } export class Query { constructor( private readonly stateRef: SubscriptionRef.SubscriptionRef>, private readonly fiberRef: SubscriptionRef.SubscriptionRef>>, ) {} private run(effect: Effect.Effect) { } // interrupt(): Effect.Effect { // return this.fiberRef.pipe( // Effect.flatMap(Option.match({ // onSome: Fiber.interrupt, // onNone: () => Effect.void, // })) // ) // } fetch = Effect.gen(this, function*() { yield* this.interrupt() }) }