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