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

Function make

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

Source from the content-addressed store, hash-verified

192 * @since 2.0.0
193 */
194export const make = <
195 Key,
196 A,
197 E = never,
198 R = never,
199 ServiceMode extends "lookup" | "construction" = never
200>(
201 options: {
202 readonly lookup: (key: Key) => Effect.Effect<A, E, R | Scope.Scope>
203 readonly capacity: number
204 readonly timeToLive?: Duration.Input | undefined
205 readonly requireServicesAt?: ServiceMode | undefined
206 }
207): Effect.Effect<
208 ScopedCache<Key, A, E, "lookup" extends ServiceMode ? Exclude<R, Scope.Scope> : never>,
209 never,
210 ("lookup" extends ServiceMode ? never : R) | Scope.Scope
211> =>
212 makeWith<Key, A, E, R, ServiceMode>({
213 ...options,
214 timeToLive: options.timeToLive !== undefined ? () => options.timeToLive! : defaultTimeToLive
215 })
216
217const Proto = {
218 ...PipeInspectableProto,

Callers

nothing calls this directly

Calls 1

makeWithFunction · 0.70

Tested by

no test coverage detected