(
options: {
readonly lookup: (key: Key) => Effect.Effect<A, E, R>
readonly capacity: number
readonly timeToLive?: Duration.Input | undefined
readonly requireServicesAt?: ServiceMode | undefined
}
)
| 286 | * @since 2.0.0 |
| 287 | */ |
| 288 | export 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 | |
| 311 | const Proto = { |
| 312 | ...PipeInspectableProto, |
nothing calls this directly
no test coverage detected