3.0.0 • Published 5 years ago

@rocketstation/local-storage v3.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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

3.0.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago