Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataStorage

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

Hierarchy

  • DataStorage

Index

Methods

Static ReadBooleanSearch playground for ReadBoolean

  • ReadBoolean(key: string, defaultValue: boolean): boolean
  • 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

Static ReadNumberSearch playground for ReadNumber

  • ReadNumber(key: string, defaultValue: number): number
  • 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

Static ReadStringSearch playground for ReadString

  • ReadString(key: string, defaultValue: string): string
  • 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

Static WriteBooleanSearch playground for WriteBoolean

  • WriteBoolean(key: string, value: boolean): void
  • Writes a boolean to the data storage

    Parameters

    • key: string

      The key to write

    • value: boolean

      The value to write

    Returns void

Static WriteNumberSearch playground for WriteNumber

  • WriteNumber(key: string, value: number): void
  • Writes a number to the data storage

    Parameters

    • key: string

      The key to write

    • value: number

      The value to write

    Returns void

Static WriteStringSearch playground for WriteString

  • WriteString(key: string, value: string): void
  • Writes a string to the data storage

    Parameters

    • key: string

      The key to write

    • value: string

      The value to write

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method