chore: generate
This commit is contained in:
parent
dd68b85f58
commit
dcb17c6a67
1 changed files with 4 additions and 3 deletions
|
|
@ -22,7 +22,9 @@ export namespace InstanceState {
|
||||||
const cache = yield* ScopedCache.make<string, A, E, R>({
|
const cache = yield* ScopedCache.make<string, A, E, R>({
|
||||||
capacity: Number.POSITIVE_INFINITY,
|
capacity: Number.POSITIVE_INFINITY,
|
||||||
lookup: (key) =>
|
lookup: (key) =>
|
||||||
Effect.acquireRelease(input.lookup(key), (value) => (input.release ? input.release(value, key) : Effect.void)),
|
Effect.acquireRelease(input.lookup(key), (value) =>
|
||||||
|
input.release ? input.release(value, key) : Effect.void,
|
||||||
|
),
|
||||||
})
|
})
|
||||||
|
|
||||||
const task: Task = (key) => ScopedCache.invalidate(cache, key)
|
const task: Task = (key) => ScopedCache.invalidate(cache, key)
|
||||||
|
|
@ -39,8 +41,7 @@ export namespace InstanceState {
|
||||||
|
|
||||||
export const has = <A, E, R>(self: State<A, E, R>) => ScopedCache.has(self.cache, Instance.directory)
|
export const has = <A, E, R>(self: State<A, E, R>) => ScopedCache.has(self.cache, Instance.directory)
|
||||||
|
|
||||||
export const invalidate = <A, E, R>(self: State<A, E, R>) =>
|
export const invalidate = <A, E, R>(self: State<A, E, R>) => ScopedCache.invalidate(self.cache, Instance.directory)
|
||||||
ScopedCache.invalidate(self.cache, Instance.directory)
|
|
||||||
|
|
||||||
export const dispose = (key: string) =>
|
export const dispose = (key: string) =>
|
||||||
Effect.all(
|
Effect.all(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue