<
K,
L extends Layer.Layer<any, any, any>,
PreloadKeys extends Iterable<K> | undefined = undefined
>(
lookup: (key: K) => L,
options?:
| {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined
readonly preloadKeys?: PreloadKeys
}
| undefined
): Effect.Effect<
LayerMap<K, Layer.Success<L>, Layer.Error<L>>,
PreloadKeys extends undefined ? never : Layer.Error<L>,
Scope.Scope | Layer.Services<L>
>Creates a LayerMap that dynamically provides resources based on a key.
Example (Creating a layer map)
import { Context, Effect, Layer, LayerMap } from "effect"
// Define a service key
const DatabaseService = Context.Service<{
readonly query: (sql: string) => Effect.Effect<string>
}>("Database")
// Create a LayerMap that provides different database configurations
const program = Effect.gen(function*() {
const layerMap = yield* LayerMap.make(
(env: string) =>
Layer.succeed(DatabaseService)({
query: Effect.fn("DatabaseService.query")((sql) => Effect.succeed(`${env}: ${sql}`))
}),
{ idleTimeToLive: "5 seconds" }
)
// Get a layer for a specific environment
const devLayer = layerMap.get("development")
// Use the layer to provide the service
const result = yield* Effect.provide(
Effect.gen(function*() {
const db = yield* DatabaseService
return yield* db.query("SELECT * FROM users")
}),
devLayer
)
console.log(result) // "development: SELECT * FROM users"
})export const const make: <
K,
L extends Layer.Layer<any, any, any>,
PreloadKeys extends
| Iterable<K>
| undefined = undefined
>(
lookup: (key: K) => L,
options?:
| {
readonly idleTimeToLive?:
| IdleTimeToLiveInput<K>
| undefined
readonly preloadKeys?: PreloadKeys
}
| undefined
) => Effect.Effect<
LayerMap<K, Layer.Success<L>, Layer.Error<L>>,
PreloadKeys extends undefined
? never
: Layer.Error<L>,
Scope.Scope | Layer.Services<L>
>
Creates a LayerMap that dynamically provides resources based on a key.
Example (Creating a layer map)
import { Context, Effect, Layer, LayerMap } from "effect"
// Define a service key
const DatabaseService = Context.Service<{
readonly query: (sql: string) => Effect.Effect<string>
}>("Database")
// Create a LayerMap that provides different database configurations
const program = Effect.gen(function*() {
const layerMap = yield* LayerMap.make(
(env: string) =>
Layer.succeed(DatabaseService)({
query: Effect.fn("DatabaseService.query")((sql) => Effect.succeed(`${env}: ${sql}`))
}),
{ idleTimeToLive: "5 seconds" }
)
// Get a layer for a specific environment
const devLayer = layerMap.get("development")
// Use the layer to provide the service
const result = yield* Effect.provide(
Effect.gen(function*() {
const db = yield* DatabaseService
return yield* db.query("SELECT * FROM users")
}),
devLayer
)
console.log(result) // "development: SELECT * FROM users"
})
make: <
function (type parameter) K in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
K,
function (type parameter) L in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
L extends import LayerLayer.type Layer.Layer = /*unresolved*/ anyLayer<any, any, any>,
function (type parameter) PreloadKeys in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
PreloadKeys extends interface Iterable<T, TReturn = any, TNext = any>Iterable<function (type parameter) K in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
K> | undefined = undefined
>(
lookup: (key: K) => Llookup: (key: Kkey: function (type parameter) K in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
K) => function (type parameter) L in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
L,
options: | {
readonly idleTimeToLive?:
| IdleTimeToLiveInput<K>
| undefined
readonly preloadKeys?: PreloadKeys
}
| undefined
options?: {
readonly idleTimeToLive?: anyidleTimeToLive?: type IdleTimeToLiveInput<K> = anyIdleTimeToLiveInput<function (type parameter) K in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
K> | undefined
readonly preloadKeys?: PreloadKeys | undefinedpreloadKeys?: function (type parameter) PreloadKeys in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
PreloadKeys
} | undefined
) => import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<
interface LayerMap<in out K, in out I, in out E = never>A scoped, keyed map of layer-built service contexts.
Details
A LayerMap builds resources for a key on demand, exposes them as a Layer
or scoped Context, and can invalidate cached resources for a key.
Example (Managing keyed layers)
import { Context, Effect, Layer, LayerMap } from "effect"
// Define a service key
const DatabaseService = Context.Service<{
readonly query: (sql: string) => Effect.Effect<string>
}>("Database")
// Create a LayerMap that provides different database configurations
const createDatabaseLayerMap = LayerMap.make((env: string) =>
Layer.succeed(DatabaseService)({
query: Effect.fn("DatabaseService.query")((sql) => Effect.succeed(`${env}: ${sql}`))
})
)
// Use the LayerMap
const program = Effect.gen(function*() {
const layerMap = yield* createDatabaseLayerMap
// Get a layer for a specific environment
const devLayer = layerMap.get("development")
// Get context directly
const context = yield* layerMap.contextEffect("production")
// Invalidate a cached layer
yield* layerMap.invalidate("development")
})
LayerMap<function (type parameter) K in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
K, import LayerLayer.type Layer.Success = /*unresolved*/ anySuccess<function (type parameter) L in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
L>, import LayerLayer.type Layer.Error = /*unresolved*/ anyError<function (type parameter) L in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
L>>,
function (type parameter) PreloadKeys in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
PreloadKeys extends undefined ? never : import LayerLayer.type Layer.Error = /*unresolved*/ anyError<function (type parameter) L in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
L>,
import ScopeScope.Scope | import LayerLayer.type Layer.Services = /*unresolved*/ anyServices<function (type parameter) L in <K, L extends Layer.Layer<any, any, any>, PreloadKeys extends Iterable<K> | undefined = undefined>(lookup: (key: K) => L, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
readonly preloadKeys?: PreloadKeys;
} | undefined): Effect.Effect<LayerMap<K, Layer.Success<L>, Layer.Error<L>>, PreloadKeys extends undefined ? never : Layer.Error<L>, Scope.Scope | Layer.Services<L>>
L>
> = import EffectEffect.fnUntraced(function*<function (type parameter) I in <I, K, EL, RL>(lookup: (key: K) => Layer.Layer<I, EL, RL>, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
} | undefined): Generator<any, any, any>
I, function (type parameter) K in <I, K, EL, RL>(lookup: (key: K) => Layer.Layer<I, EL, RL>, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
} | undefined): Generator<any, any, any>
K, function (type parameter) EL in <I, K, EL, RL>(lookup: (key: K) => Layer.Layer<I, EL, RL>, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
} | undefined): Generator<any, any, any>
EL, function (type parameter) RL in <I, K, EL, RL>(lookup: (key: K) => Layer.Layer<I, EL, RL>, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
} | undefined): Generator<any, any, any>
RL>(
lookup: (key: K) => Layer.Layer<I, EL, RL>lookup: (key: Kkey: function (type parameter) K in <I, K, EL, RL>(lookup: (key: K) => Layer.Layer<I, EL, RL>, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
} | undefined): Generator<any, any, any>
K) => import LayerLayer.type Layer.Layer = /*unresolved*/ anyLayer<function (type parameter) I in <I, K, EL, RL>(lookup: (key: K) => Layer.Layer<I, EL, RL>, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
} | undefined): Generator<any, any, any>
I, function (type parameter) EL in <I, K, EL, RL>(lookup: (key: K) => Layer.Layer<I, EL, RL>, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
} | undefined): Generator<any, any, any>
EL, function (type parameter) RL in <I, K, EL, RL>(lookup: (key: K) => Layer.Layer<I, EL, RL>, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
} | undefined): Generator<any, any, any>
RL>,
options: | {
readonly idleTimeToLive?:
| IdleTimeToLiveInput<K>
| undefined
}
| undefined
options?: {
readonly idleTimeToLive?: anyidleTimeToLive?: type IdleTimeToLiveInput<K> = anyIdleTimeToLiveInput<function (type parameter) K in <I, K, EL, RL>(lookup: (key: K) => Layer.Layer<I, EL, RL>, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
} | undefined): Generator<any, any, any>
K> | undefined
} | undefined
) {
const const context: Context.Context<never>const context: {
mapUnsafe: ReadonlyMap<string, any>;
mutable: boolean;
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;
}
context = yield* import EffectEffect.context<never>()
const const memoMap: Layer.MemoMapconst memoMap: {
get: <RIn, E, ROut>(layer: Layer<ROut, E, RIn>, scope: Scope.Scope) => Effect<Context.Context<ROut>, E, RIn> | undefined;
getOrElseMemoize: <RIn, E, ROut>(layer: Layer<ROut, E, RIn>, scope: Scope.Scope, build: (memoMap: MemoMap, scope: Scope.Scope) => Effect<Context.Context<ROut>, E, RIn>) => Effect<Context.Context<ROut>, E, RIn>;
}
memoMap = import LayerLayer.CurrentMemoMap.forkOrCreate(const context: Context.Context<never>const context: {
mapUnsafe: ReadonlyMap<string, any>;
mutable: boolean;
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;
}
context)
const const rcMap: RcMap.RcMap<
K,
Context.Context<I>,
EL
>
const rcMap: {
lookup: (key: K) => Effect.Effect<A, E, Scope.Scope>;
context: Context.Context<never>;
scope: Scope.Scope;
idleTimeToLive: (key: K) => Duration.Duration;
capacity: number;
state: State<K, A, E>;
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; <…;
}
rcMap = yield* import RcMapRcMap.const make: {
<K, A, E, R>(options: {
readonly lookup: (
key: K
) => Effect.Effect<A, E, R>
readonly idleTimeToLive?:
| Duration.Input
| ((key: K) => Duration.Input)
| undefined
readonly capacity?: undefined
}): Effect.Effect<
RcMap<K, A, E>,
never,
Scope.Scope | R
>
<K, A, E, R>(options: {
readonly lookup: (
key: K
) => Effect.Effect<A, E, R>
readonly idleTimeToLive?:
| Duration.Input
| ((key: K) => Duration.Input)
| undefined
readonly capacity: number
}): Effect.Effect<
RcMap<K, A, E | Cause.ExceededCapacityError>,
never,
Scope.Scope | R
>
}
make({
lookup: (
key: K
) => Effect.Effect<unknown, unknown, unknown>
lookup: (key: Kkey: function (type parameter) K in <I, K, EL, RL>(lookup: (key: K) => Layer.Layer<I, EL, RL>, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
} | undefined): Generator<any, any, any>
K) =>
import EffectEffect.contextWith((_: Context.Context<Scope.Scope>(parameter) _: {
mapUnsafe: ReadonlyMap<string, any>;
mutable: boolean;
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;
}
_: import ContextContext.type Context.Context = /*unresolved*/ anyContext<import ScopeScope.Scope>) =>
import LayerLayer.buildWithMemoMap(lookup: (key: K) => Layer.Layer<I, EL, RL>lookup(key: Kkey), const memoMap: Layer.MemoMapconst memoMap: {
get: <RIn, E, ROut>(layer: Layer<ROut, E, RIn>, scope: Scope.Scope) => Effect<Context.Context<ROut>, E, RIn> | undefined;
getOrElseMemoize: <RIn, E, ROut>(layer: Layer<ROut, E, RIn>, scope: Scope.Scope, build: (memoMap: MemoMap, scope: Scope.Scope) => Effect<Context.Context<ROut>, E, RIn>) => Effect<Context.Context<ROut>, E, RIn>;
}
memoMap, import ContextContext.get(_: Context.Context<Scope.Scope>(parameter) _: {
mapUnsafe: ReadonlyMap<string, any>;
mutable: boolean;
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;
}
_, import ScopeScope.const Scope: Context.Service<Scope, Scope>const Scope: {
key: string;
Service: {
strategy: "sequential" | "parallel";
state: State.Open | State.Closed | State.Empty;
};
of: (this: void, self: Scope.Scope) => Scope.Scope;
context: (self: Scope.Scope) => Context.Context<Scope.Scope>;
use: (f: (service: Scope.Scope) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, Scope.Scope | R>;
useSync: (f: (service: Scope.Scope) => A) => Effect.Effect<A, never, Scope.Scope>;
Identifier: Identifier;
stack: string | undefined;
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;
}
A Scope represents a context where resources can be acquired and
automatically cleaned up when the scope is closed. Scopes can use
either sequential or parallel finalization strategies.
Example (Managing scoped resources)
import { Effect, Exit, Scope } from "effect"
const program = Effect.gen(function*() {
const scope = yield* Scope.make("sequential")
// Scope has a strategy and state
console.log(scope.strategy) // "sequential"
console.log(scope.state._tag) // "Open"
// Close the scope
yield* Scope.close(scope, Exit.void)
console.log(scope.state._tag) // "Closed"
})
Service tag for the active resource lifetime.
When to use
Use to access the active lifetime when registering finalizers or sharing
resources with the surrounding scope.
Example (Accessing the scope service)
import { Effect, Scope } from "effect"
const program = Effect.gen(function*() {
// Access the scope from the context
const scope = yield* Scope.Scope
// Use the scope for resource management
yield* Scope.addFinalizer(scope, Effect.log("Cleanup"))
})
// Provide a scope to the program
const scoped = Effect.scoped(program)
Scope))
),
idleTimeToLive?: anyidleTimeToLive: options: | {
readonly idleTimeToLive?:
| IdleTimeToLiveInput<K>
| undefined
}
| undefined
options?.idleTimeToLive?: anyidleTimeToLive
})
return import identityidentity<interface LayerMap<in out K, in out I, in out E = never>A scoped, keyed map of layer-built service contexts.
Details
A LayerMap builds resources for a key on demand, exposes them as a Layer
or scoped Context, and can invalidate cached resources for a key.
Example (Managing keyed layers)
import { Context, Effect, Layer, LayerMap } from "effect"
// Define a service key
const DatabaseService = Context.Service<{
readonly query: (sql: string) => Effect.Effect<string>
}>("Database")
// Create a LayerMap that provides different database configurations
const createDatabaseLayerMap = LayerMap.make((env: string) =>
Layer.succeed(DatabaseService)({
query: Effect.fn("DatabaseService.query")((sql) => Effect.succeed(`${env}: ${sql}`))
})
)
// Use the LayerMap
const program = Effect.gen(function*() {
const layerMap = yield* createDatabaseLayerMap
// Get a layer for a specific environment
const devLayer = layerMap.get("development")
// Get context directly
const context = yield* layerMap.contextEffect("production")
// Invalidate a cached layer
yield* layerMap.invalidate("development")
})
LayerMap<function (type parameter) K in <I, K, EL, RL>(lookup: (key: K) => Layer.Layer<I, EL, RL>, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
} | undefined): Generator<any, any, any>
K, function (type parameter) I in <I, K, EL, RL>(lookup: (key: K) => Layer.Layer<I, EL, RL>, options?: {
readonly idleTimeToLive?: IdleTimeToLiveInput<K> | undefined;
} | undefined): Generator<any, any, any>
I, any>>({
[const TypeId: "~effect/LayerMap"TypeId]: const TypeId: "~effect/LayerMap"TypeId,
rcMap: RcMap.RcMap<K, Context.Context<I>, EL>(property) rcMap: {
lookup: (key: K) => Effect.Effect<A, E, Scope.Scope>;
context: Context.Context<never>;
scope: Scope.Scope;
idleTimeToLive: (key: K) => Duration.Duration;
capacity: number;
state: State<K, A, E>;
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; <…;
}
rcMap,
get: (key: any) => anyget: (key: anykey) => import LayerLayer.effectContext(import RcMapRcMap.const get: {
<K>(key: K): <A, E>(
self: RcMap<K, A, E>
) => Effect.Effect<A, E, Scope.Scope>
<K, A, E>(
self: RcMap<K, A, E>,
key: K
): Effect.Effect<A, E, Scope.Scope>
}
get(const rcMap: RcMap.RcMap<
K,
Context.Context<I>,
EL
>
const rcMap: {
lookup: (key: K) => Effect.Effect<A, E, Scope.Scope>;
context: Context.Context<never>;
scope: Scope.Scope;
idleTimeToLive: (key: K) => Duration.Duration;
capacity: number;
state: State<K, A, E>;
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; <…;
}
rcMap, key: anykey)),
contextEffect: (
key: any
) => Effect.Effect<A, E, Scope.Scope>
contextEffect: (key: anykey) => import RcMapRcMap.const get: {
<K>(key: K): <A, E>(
self: RcMap<K, A, E>
) => Effect.Effect<A, E, Scope.Scope>
<K, A, E>(
self: RcMap<K, A, E>,
key: K
): Effect.Effect<A, E, Scope.Scope>
}
get(const rcMap: RcMap.RcMap<
K,
Context.Context<I>,
EL
>
const rcMap: {
lookup: (key: K) => Effect.Effect<A, E, Scope.Scope>;
context: Context.Context<never>;
scope: Scope.Scope;
idleTimeToLive: (key: K) => Duration.Duration;
capacity: number;
state: State<K, A, E>;
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; <…;
}
rcMap, key: anykey),
invalidate: (key: any) => Effect.Effect<void>invalidate: (key: anykey) => import RcMapRcMap.const invalidate: {
<K>(key: K): <A, E>(
self: RcMap<K, A, E>
) => Effect.Effect<void>
<K, A, E>(
self: RcMap<K, A, E>,
key: K
): Effect.Effect<void>
}
invalidate(const rcMap: RcMap.RcMap<
K,
Context.Context<I>,
EL
>
const rcMap: {
lookup: (key: K) => Effect.Effect<A, E, Scope.Scope>;
context: Context.Context<never>;
scope: Scope.Scope;
idleTimeToLive: (key: K) => Duration.Duration;
capacity: number;
state: State<K, A, E>;
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; <…;
}
rcMap, key: anykey)
})
})