MCPcopy Create free account
hub / github.com/Effect-TS/effect / make

Function make

packages/effect/src/Cache.ts:288–309  ·  view source on GitHub ↗
(
  options: {
    readonly lookup: (key: Key) => Effect.Effect<A, E, R>
    readonly capacity: number
    readonly timeToLive?: Duration.Input | undefined
    readonly requireServicesAt?: ServiceMode | undefined
  }
)

Source from the content-addressed store, hash-verified

286 * @since 2.0.0
287 */
288export const make = <
289 Key,
290 A,
291 E = never,
292 R = never,
293 ServiceMode extends "lookup" | "construction" = never
294>(
295 options: {
296 readonly lookup: (key: Key) => Effect.Effect<A, E, R>
297 readonly capacity: number
298 readonly timeToLive?: Duration.Input | undefined
299 readonly requireServicesAt?: ServiceMode | undefined
300 }
301): Effect.Effect<
302 Cache<Key, A, E, "lookup" extends ServiceMode ? R : never>,
303 never,
304 "lookup" extends ServiceMode ? never : R
305> =>
306 makeWith<Key, A, E, R, ServiceMode>(options.lookup, {
307 ...options,
308 timeToLive: options.timeToLive !== undefined ? () => options.timeToLive! : defaultTimeToLive
309 })
310
311const Proto = {
312 ...PipeInspectableProto,

Callers

nothing calls this directly

Calls 1

makeWithFunction · 0.70

Tested by

no test coverage detected