0.0.7 • Published 6 years ago

pdsb-storage-manager v0.0.7

Weekly downloads
29
License
SEE LICENSE IN LI...
Repository
github
Last release
6 years ago

pdsb-storage-manager

  • Simple web storage manager to work with multiple apps under the same domain.
  • The manager will use local / session storage if available.
  • Otherwise, it will revert to using cookies.

Information

  • Items common across applications are prefixed with '/sis/', otherwise, they are prefixed with '/BASE_HREF/'.
  • When using local / session storage, items set to expire use sessionStorage, otherwise, localStorage is used.
  • In the case of cookies, items set to persist are appended with '/!' to signify a non-session cookie.

Usage

  • Provide the PdsbStorageManagerService in your app.module.ts file.
  • Inject the service into your component, service, etc.

get(key: string): string

  • Returns the object stored at the given key

set(key: string, val: string | number | boolean | object | Array, expires: boolean = true, common: boolean = false): boolean

  • Sets the object by storing it in local or session storage (or to a cookie)

remove(key: string, track: boolean = true)

  • Removes an item from either the local or session storage (or from a cookie)

removeAll(force: boolean = true)

  • Removes all session storage items either for the app only, or for the '/common/' items as well
0.0.8

5 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago