diff --git a/packages/extension-query/src/QueryService.ts b/packages/extension-query/src/QueryService.ts index 687ebf0..6ef7d91 100644 --- a/packages/extension-query/src/QueryService.ts +++ b/packages/extension-query/src/QueryService.ts @@ -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 = (id: Id) => < @@ -8,4 +9,16 @@ export const Tag = (id: Id) => < >() => Effect.Tag(id)>() -export const Service = () => +export interface ServiceProps { + readonly key: Stream.Stream + readonly query: (key: K) => Effect.Effect + readonly options?: QueryRunner.RunOptions +} + +export const Service = () => < + const Id extends string, + K extends readonly unknown[], A, E, R, +>( + id: Id, + props: ServiceProps, +) =>