@yoshteq/ti365-ts-sdk
    Preparing search index...

    Class CacheService

    Internal Service that stores values in localStorage for caching that outlive the ram.

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Migrates the old version of the localStorage by purging it.

      Returns void

    • Stores a value in the cache.

      Parameters

      • bucket: string

        the main Storage Bucket

      • key: string

        the SubKey

      • value: undefined | string | object

        The value to be stored, if undefined the cache value will be deleted.

      • OptionaltimeToLive: number

        Milliseconds the cache will be valid. If undefined, the cache value will be stored indefinitely.

      Returns void

    • Reads a Cache Value.

      Type Parameters

      • T

      Parameters

      • bucket: string

        the main Storage Bucket

      • key: string

        the SubKey

      Returns undefined | T

      the value T. If the value does not exist or is outdated it will return undefined.