Commit cfba6fdcb78b4019f623639fbd7dfecaacb4ab1c
added state interface
wanderer committed on 2/25/2017, 11:56:23 AMParent: 0f4618d69a1944599b2e15d8398df11ca4901eaa
Files changed
stateInterface.js | added |
stateInterface.js | ||
---|---|---|
@@ -1,0 +1,17 @@ | ||
1 | +module.exports = class StateInterface { | |
2 | + constuctor (state) { | |
3 | + this.state = state | |
4 | + } | |
5 | + | |
6 | + set (name, value) { | |
7 | + this.state.set([name], value) | |
8 | + } | |
9 | + | |
10 | + get (name) { | |
11 | + return this.state.get([name]) | |
12 | + } | |
13 | + | |
14 | + delete (name) { | |
15 | + return this.state.del([name]) | |
16 | + } | |
17 | +} |
Built with git-ssb-web