You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/assets/javascripts/lib/store.coffee

24 lines
348 B

class @Store
get: (key) ->
try
JSON.parse localStorage.getItem(key)
catch
set: (key, value) ->
try
localStorage.setItem(key, JSON.stringify(value))
true
catch
del: (key) ->
try
localStorage.removeItem(key)
true
catch
clear: ->
try
localStorage.clear()
true
catch