Type Alias CacheSettingsBase<TType>

CacheSettingsBase: {
    defaultTtl?: ITimeSpan | null;
    eventBus?: IEventBus;
    namespace?: Namespace;
    schema?: StandardSchemaV1<TType>;
    shouldValidateOutput?: boolean;
}

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

Type Parameters

  • TType = unknown

Type declaration

  • OptionaldefaultTtl?: ITimeSpan | 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/memory-event-bus-adapter";

    new EventBus({
    adapter: new MemoryEventBusAdapter()
    })
  • Optionalnamespace?: Namespace
    import { Namespace } from "@daiso-tech/core/namespace";

    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