This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import type * as AsyncData from "@typed/async-data"
|
||||
import { type Cause, Effect, type Fiber, type SubscriptionRef } from "effect"
|
||||
import { type Cause, Effect, type Fiber, type Stream, type SubscriptionRef } from "effect"
|
||||
|
||||
|
||||
export interface QueryService<A, E> {
|
||||
export interface QueryService<K extends readonly unknown[], A, E> {
|
||||
readonly keyStream: Stream.Stream<K>
|
||||
readonly state: SubscriptionRef.SubscriptionRef<AsyncData.AsyncData<A, E>>
|
||||
readonly refresh: Effect.Effect<Fiber.RuntimeFiber<void, Cause.NoSuchElementException>>
|
||||
}
|
||||
|
||||
export const Tag = <const Id extends string>(id: Id) => <
|
||||
Self, A, E = never,
|
||||
>() => Effect.Tag(id)<Self, QueryService<A, E>>()
|
||||
Self, K extends readonly unknown[], A, E = never,
|
||||
>() => Effect.Tag(id)<Self, QueryService<K, A, E>>()
|
||||
|
||||
|
||||
// export interface LayerProps<A, E, R> {
|
||||
|
||||
Reference in New Issue
Block a user