8000 GitHub - rocketstation/local-storage: creates helpers to work with specific items inside local storage
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

creates helpers to work with specific items inside local storage

Notifications You must be signed in to change notification settings

rocketstation/local-storage

Repository files navigation

Local Storage

Local Storage creates your personal bubble inside local storage. It assigns object to specific key and returns helpers for modifying it

Installation

npm i @rocketstation/local-storage

Usage

import localStorage from '@rocketstation/local-storage'

const ls = localStorage('key')

ls.get() // {}

ls.set({ foo: 'bar' })
ls.get() // { foo: 'bar' }

ls.remove('foo')
ls.get() // {}

ls.add('foo', 'bar')
ls.get() // { foo: 'bar }

ls.update({ bar: 'foo' })
ls.get() // { foo: 'bar,  bar: 'foo'  }

Motivation

We were tired of writing this code again and again

License

Local Storage is licensed under the MIT License

Created by RocketStation

About

creates helpers to work with specific items inside local storage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0