Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StorageBag

Hierarchy

  • StorageBag

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

provider

Methods

clear

  • clear(): void

del

  • del(key: any): void

get

  • get(key: any, options?: any): any

getSize

  • getSize(key: any): string
  • Get total localstorage size in MB. If key is provided, it will return size in MB only for the corresponding item.

    Parameters

    • key: any

    Returns string

on

  • on(callback: Function): void

set

  • set(key: any, val: any, options?: any): void
  • Save a value to the storage

    Parameters

    • key: any

      The unique id to save the data on

    • val: any

      The value, can be any datatype. If it's an object, make sure to enable json in the options

    • Optional options: any

    Returns void