Skip to content

Commit

Permalink
feat(store): add memory store
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanebachelier committed Jan 3, 2016
1 parent a80adf3 commit 118d462
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/memory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class MemoryStore {
constructor () {
this._store = {}
}

getItem (key) {
return this._store[key] || null
}

setItem (key, value) {
this._store[key] = value
return this
}

clear () {
this._store = {}
return this
}
}

export default MemoryStore;

0 comments on commit 118d462

Please sign in to comment.