Created
October 15, 2013 22:11
-
-
Save kapv89/6999469 to your computer and use it in GitHub Desktop.
A simple session implementation for angular apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function () { | |
return [function () { | |
var keyName = API_KEY_NAME; | |
var key = localStorage.getItem('sessionKey'); | |
return { | |
keyName: function () { | |
return keyName; | |
}, | |
key: function () { | |
return key; | |
}, | |
setKey: function (val) { | |
key = val; | |
localStorage.setItem('sessionKey', key) | |
} | |
} | |
}] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The essence of simplicity :)