TagClass<Self, Id, I, E, R, LE, Deps>Service class shape produced by LayerRef.Service.
When to use
Use as the public type for classes returned by LayerRef.Service when an API
needs to accept, return, or alias the generated service class and its static
helpers.
Details
It combines a Context.Service tag for the LayerRef with default layers and
helper accessors for retrieving, using, and invalidating the cached resource.
export interface interface TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Service class shape produced by LayerRef.Service.
When to use
Use as the public type for classes returned by LayerRef.Service when an API
needs to accept, return, or alias the generated service class and its static
helpers.
Details
It combines a Context.Service tag for the LayerRef with default layers and
helper accessors for retrieving, using, and invalidating the cached resource.
TagClass<
in out function (type parameter) Self in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Self,
in out function (type parameter) Id in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Id extends string,
in out function (type parameter) I in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>I,
in out function (type parameter) E in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>E,
in out function (type parameter) R in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>R,
in out function (type parameter) LE in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>LE,
in out function (type parameter) Deps in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Deps extends import LayerLayer.type Layer.Layer = /*unresolved*/ anyLayer<any, any, any>
> extends import ContextContext.ServiceClass<function (type parameter) Self in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Self, function (type parameter) Id in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Id, interface LayerRef<in out I, in out E = never>A refreshable reference to a single layer-built service context.
When to use
Use when you want to share one scoped layer resource across many users while
retaining the ability to invalidate it and rebuild it later.
Details
A LayerRef is the unkeyed counterpart to a layer cache: it lazily builds the
layer on first use, reuses the resulting context while it is borrowed or kept
idle, and can invalidate the cached context so the next use rebuilds it.
LayerRef<function (type parameter) I in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>I, function (type parameter) E in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>E>> {
/**
* Default layer for the `LayerRef` service, with dependencies applied.
*/
readonly TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>.layer: Layer.Layer<Self, (Deps extends Layer.Layer<infer _A, infer _E, infer _R> ? _E : never) | LE, Exclude<R, (Deps extends Layer.Layer<infer _A, infer _E, infer _R> ? _A : never)> | (Deps extends Layer.Layer<infer _A, infer _E, infer _R> ? _R : never)>(property) TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>.layer: {
build: (memoMap: MemoMap, scope: Scope.Scope) => Effect<Context.Context<Self>, LE | (Deps extends Layer<infer _A, infer _E, infer _R> ? _E : never), Exclude<R, Deps extends Layer<infer _A, infer _E, infer _R> ? _A : never> | (Deps extends Layer<i…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Default layer for the LayerRef service, with dependencies applied.
layer: import LayerLayer.type Layer.Layer = /*unresolved*/ anyLayer<
function (type parameter) Self in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Self,
(function (type parameter) Deps in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Deps extends import LayerLayer.type Layer.Layer = /*unresolved*/ anyLayer<infer function (type parameter) _A_A, infer function (type parameter) _E_E, infer function (type parameter) _R_R> ? function (type parameter) _E_E : never) | function (type parameter) LE in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>LE,
| type Exclude<T, U> = T extends U
? never
: T
Exclude from T those types that are assignable to U
Exclude<function (type parameter) R in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>R, (function (type parameter) Deps in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Deps extends import LayerLayer.type Layer.Layer = /*unresolved*/ anyLayer<infer function (type parameter) _A_A, infer function (type parameter) _E_E, infer function (type parameter) _R_R> ? function (type parameter) _A_A : never)>
| (function (type parameter) Deps in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Deps extends import LayerLayer.type Layer.Layer = /*unresolved*/ anyLayer<infer function (type parameter) _A_A, infer function (type parameter) _E_E, infer function (type parameter) _R_R> ? function (type parameter) _R_R : never)
>
/**
* Default layer for the `LayerRef` service without provided dependencies.
*/
readonly TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>.layerNoDeps: Layer.Layer<Self, LE, R>(property) TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>.layerNoDeps: {
build: (memoMap: MemoMap, scope: Scope.Scope) => Effect<Context.Context<Self>, LE, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Default layer for the LayerRef service without provided dependencies.
layerNoDeps: import LayerLayer.type Layer.Layer = /*unresolved*/ anyLayer<function (type parameter) Self in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Self, function (type parameter) LE in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>LE, function (type parameter) R in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>R>
/**
* Layer that provides the currently cached context, requiring this service.
*/
readonly TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>.get: Layer.Layer<I, E, Self>(property) TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>.get: {
build: (memoMap: MemoMap, scope: Scope.Scope) => Effect<Context.Context<I>, E, Self>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Layer that provides the currently cached context, requiring this service.
get: import LayerLayer.type Layer.Layer = /*unresolved*/ anyLayer<function (type parameter) I in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>I, function (type parameter) E in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>E, function (type parameter) Self in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Self>
/**
* Scoped effect that retrieves the currently cached context through this service.
*/
readonly TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>.contextEffect: Effect.Effect<Context.Context<I>, E, Scope.Scope | Self>(property) TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>.contextEffect: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Scoped effect that retrieves the currently cached context through this service.
contextEffect: import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<import ContextContext.type Context.Context = /*unresolved*/ anyContext<function (type parameter) I in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>I>, function (type parameter) E in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>E, import ScopeScope.Scope | function (type parameter) Self in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Self>
/**
* Invalidates the cached context through this service.
*/
readonly TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>.invalidate: Effect.Effect<void, never, Self>(property) TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>.invalidate: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Invalidates the cached context through this service.
invalidate: import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<void, never, function (type parameter) Self in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Self>
/**
* Invalidates the cached context through this service, and reacquires it.
*/
readonly TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>.refresh: Effect.Effect<void, E, Self>(property) TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>.refresh: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Invalidates the cached context through this service, and reacquires it.
refresh: import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<void, function (type parameter) E in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>E, function (type parameter) Self in TagClass<in out Self, in out Id extends string, in out I, in out E, in out R, in out LE, in out Deps extends Layer.Layer<any, any, any>>Self>
}