mirror of
https://github.com/documize/community.git
synced 2025-08-08 15:05:28 +02:00
Create new local-storage service
This commit is contained in:
parent
5bd92b7f63
commit
37e3434158
1 changed files with 16 additions and 0 deletions
16
app/app/services/local-storage.js
Normal file
16
app/app/services/local-storage.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import Ember from 'ember';
|
||||||
|
|
||||||
|
export default Ember.Service.extend({
|
||||||
|
|
||||||
|
storeSessionItem: function(key, data) {
|
||||||
|
localStorage[key] = data;
|
||||||
|
},
|
||||||
|
|
||||||
|
getSessionItem: function(key) {
|
||||||
|
return localStorage[key];
|
||||||
|
},
|
||||||
|
|
||||||
|
clearSessionItem: function(key) {
|
||||||
|
delete localStorage[key];
|
||||||
|
}
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue