Skip to content

Interface: GetOrSetOptions

Options for the Cacheable-compatible get-or-set extension.

  • GetOrSetFunctionOptions

readonly optional cachedOnErrorTtl?: string | number

TTL for the cached-on-error value. Defaults to 0, meaning no expiration.


optional cacheErrors?: boolean

GetOrSetFunctionOptions.cacheErrors


optional nonBlocking?: boolean

If set, this will bypass the instances nonBlocking setting for the get call.

GetOrSetFunctionOptions.nonBlocking


readonly optional returnCachedOnError?: boolean

Return a separately retained successful value when the loader fails. Defaults to false.


optional throwErrors?: boolean | GetOrSetThrowErrorsContext

Whether or not to throw errors:

  • false (default) - do not throw any errors
  • true - throw any error
  • "function" - only throw errors that occur in the provided function / setter
  • "store" - only throw errors that occur when getting/setting the cache

GetOrSetFunctionOptions.throwErrors


optional ttl?: string | number | PerStoreTtl

GetOrSetFunctionOptions.ttl