Home Manual Reference Source Test Demo
public class | source

LocalStorageHelper

DataService Class for Storing Values in the LocalStorage in the browser

Static Method Summary

Static Public Methods
public static

get(objectPattern: {"key": *}): string | object

Retrieves a value stored at the key in browser LocalStorage

public static

save(objectPattern: {"key": *, "val": *}): undefined

Saves the value at the key provided in the browser localStorage

Static Public Methods

public static get(objectPattern: {"key": *}): string | object source

Retrieves a value stored at the key in browser LocalStorage

Params:

NameTypeAttributeDescription
objectPattern {"key": *}
  • default: {"key":null}

Return:

string | object

the value stored at the key in the LocalStorage

public static save(objectPattern: {"key": *, "val": *}): undefined source

Saves the value at the key provided in the browser localStorage

Params:

NameTypeAttributeDescription
objectPattern {"key": *, "val": *}
  • default: {"key":null,"val":null}

Return:

undefined

undefined