Type Alias CacheSettingsBase<TType>

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

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

Type Parameters

  • TType = unknown

Type declaration

  • OptionaldefaultJitter?: number | null

    You can pass jitter value to ensure the backoff will not execute at the same time. If you pas null you can disable the jitrter.

    0.2
    
  • 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 { NoOpEventBusAdapter } from "@daiso-tech/core/event-bus/no-op-event-bus-adapter";

    new EventBus({
    adapter: new NoOpEventBusAdapter()
    })
  • Optionalnamespace?: INamespace
    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