Thanks to visit codestin.com
Credit goes to effect-ts.github.io

Skip to main content Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

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