0.1.13 #18

Merged
Thilawyn merged 359 commits from next into master 2025-06-18 00:12:19 +02:00
Showing only changes of commit 2e00db5778 - Show all commits

View File

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