Service work
Some checks failed
Lint / lint (push) Failing after 14s

This commit is contained in:
Julien Valverdé
2025-05-23 05:12:21 +02:00
parent 1c99d5c161
commit 6edac19fa6

View File

@@ -1,6 +1,7 @@
import type * as AsyncData from "@typed/async-data"
import { type Cause, Effect, type Fiber, type Option, type Stream, type SubscriptionRef } from "effect"
import * as QueryRunner from "./QueryRunner.js"
import * as QueryProgress from "./QueryProgress.js"
export const Tag = <const Id extends string>(id: Id) => <
@@ -8,4 +9,16 @@ export const Tag = <const Id extends string>(id: Id) => <
>() => Effect.Tag(id)<Self, QueryRunner.QueryRunner<K, A, E>>()
export const Service = <Self>() =>
export interface ServiceProps<K extends readonly unknown[], A, E, R> {
readonly key: Stream.Stream<K>
readonly query: (key: K) => Effect.Effect<A, E, R | QueryProgress.QueryProgress>
readonly options?: QueryRunner.RunOptions
}
export const Service = <Self>() => <
const Id extends string,
K extends readonly unknown[], A, E, R,
>(
id: Id,
props: ServiceProps<K, A, E, R>,
) =>