Skip to content

Instantly share code, notes, and snippets.

@rizowski
Created October 4, 2013 05:58
Show Gist options
  • Save rizowski/6821566 to your computer and use it in GitHub Desktop.
Save rizowski/6821566 to your computer and use it in GitHub Desktop.
# the variable I am trying to use
canvaskey = ""
# the callback method to set the variable
setkey = (item) =>
canvaskey = item
# Starting the chain
getcanvaskey = () =>
chrome.storage.local.get('key', (item) ->
setkey(item.canvaskey)
)
# this is the same as
localStorage.key
# or
localStorage['key']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment