Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MockStorage

Hierarchy

  • MockStorage

Implements

  • Storage

Indexable

[index: number]: string

Index

Properties

Accessors

Methods

Properties

Private store

store: any

Accessors

length

  • get length(): number
  • Function to get number of keys in store

    Returns number

    number of keys in the store

Methods

clear

  • clear(): void
  • Function to clear the entire contents of the store

    Returns void

getItem

  • getItem(key: string): string | any
  • Fetch an item from the store

    Parameters

    • key: string

    Returns string | any

    the data on that key

key

  • key(index: number): string | any
  • Get a key by it's index in the store (The order of keys are set by when they are first created)

    Parameters

    • index: number

    Returns string | any

    name of the key

removeItem

  • removeItem(key: string): void
  • Delete an item from the store

    Parameters

    • key: string

    Returns void

setItem

  • setItem(key: string, data: string): void
  • Add an item to the store

    Parameters

    • key: string
    • data: string

      (remember to stringify it, if it's not string)

    Returns void

Generated using TypeDoc