Skip to content

simplyGits/reactive-local-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A reactive way to access localStorage.

The API is the same as localStorage, expect that length isn't included, use count() instead.

meteor add simply:reactive-local-storage
import * as RLocalStorage from 'meteor/simply:reactive-local-storage'

Tracker.autorun(function () {
	console.log(RLocalStorage.getItem('key')) // reactivly log localStorage['key'] to the console.
})
RLocalStorage.setItem('key', 'value') // set localStorage['key'] to 'value'
setTimeout(function () {
	RLocalStorage.removeItem('key') // remove localStorage['key'] after 2 seconds.
}, 2000)

About

A reactive way to access localStorage.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published