Type Alias CacheSettingsBase<TType>

CacheSettingsBase: {
    defaultTtl?: TimeSpan | null;
    eventBus?: IEventBus;
    lazyPromiseFactory?: Factory<AsyncLazy<any>, LazyPromise<any>>;
    namespace?: Namespace;
    schema?: StandardSchemaV1<TType>;
    shouldValidateOutput?: boolean;
}

IMPORT_PATH: "@daiso-tech/core/cache"

Type Parameters

  • TType = unknown

Type declaration

  • OptionaldefaultTtl?: TimeSpan | null

    You can decide the default ttl value. If null is passed then no ttl will be used by default.

    {null}
    
  • OptionaleventBus?: IEventBus
    import { EventBus } from "@daiso-tech/core/event-bus";
    import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/adapters";

    new EventBus({
    adapter: new MemoryEventBusAdapter()
    })
  • OptionallazyPromiseFactory?: Factory<AsyncLazy<any>, LazyPromise<any>>

    You can pass a Factory of LazyPromise to configure default settings for all LazyPromise instances used in the Cache class.

    import { LazyPromise } from "@daiso-tech/core/async";

    (invokable) => new LazyPromise(invokable)
  • Optionalnamespace?: Namespace
    import { Namespace } from "@daiso-tech/core/utilities";

    new Namespace(["@", "cache"])
  • Optionalschema?: StandardSchemaV1<TType>

    You can provide any standard schema compliant object to validate all input and output data to ensure runtime type safety.

  • OptionalshouldValidateOutput?: boolean

    You can enable validating cache values when retrieving them.

    {true}