Skip to main content Link Search Menu Expand Document (external link)

PersistedCache.ts overview

Since v1.0.0


Exports Grouped by Category


constructors

make

Signature

declare const make: <K extends Persistence.ResultPersistence.KeyAny, R>(options: {
  readonly storeId: string
  readonly lookup: (key: K) => Effect.Effect<Schema.WithResult.Success<K>, Schema.WithResult.Failure<K>, R>
  readonly timeToLive: (...args: Persistence.ResultPersistence.TimeToLiveArgs<K>) => Duration.DurationInput
  readonly inMemoryCapacity?: number | undefined
  readonly inMemoryTTL?: Duration.DurationInput | undefined
}) => Effect.Effect<
  PersistedCache<K>,
  never,
  Schema.SerializableWithResult.Context<K> | R | Persistence.ResultPersistence | Scope.Scope
>

Source

Since v1.0.0

models

PersistedCache (interface)

Signature

export interface PersistedCache<K extends Persistence.ResultPersistence.KeyAny> {
  readonly get: (
    key: K
  ) => Effect.Effect<Schema.WithResult.Success<K>, Schema.WithResult.Failure<K> | Persistence.PersistenceError>
  readonly invalidate: (key: K) => Effect.Effect<void, Persistence.PersistenceError>
}

Source

Since v1.0.0