Chok’s Typescript Utilities
    Preparing search index...

    Class LocalStoreItem<T>

    Class to represent one key in the store with a default expiration.

    Type Parameters

    • T
    Index

    Constructors

    Properties

    defaultExpiryMs: number
    key: string
    store: LocalStore = localStore

    Methods

    • Delete this key from the store.

      Returns void

    • Get a value by key, or undefined if it does not exist.

      Returns T | undefined

    • Set a value in the store.

      Parameters

      • value: T
      • expiryDeltaMs: number | undefined = ...

      Returns void