Class DataStorage

Class for storing data to local storage if available or in-memory storage otherwise

Constructors

Methods

  • Reads a boolean from the data storage

    Parameters

    • key: string

      The key to read

    • defaultValue: boolean

      The value if the key doesn't exist

    Returns boolean

    The boolean value

  • Reads a number from the data storage

    Parameters

    • key: string

      The key to read

    • defaultValue: number

      The value if the key doesn't exist

    Returns number

    The number value

  • Reads a string from the data storage

    Parameters

    • key: string

      The key to read

    • defaultValue: string

      The value if the key doesn't exist

    Returns string

    The string value

  • Writes a boolean to the data storage

    Parameters

    • key: string

      The key to write

    • value: boolean

      The value to write

    Returns void

  • Writes a number to the data storage

    Parameters

    • key: string

      The key to write

    • value: number

      The value to write

    Returns void

  • Writes a string to the data storage

    Parameters

    • key: string

      The key to write

    • value: string

      The value to write

    Returns void

Generated using TypeDoc