-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(redux): add wechat storage methods
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {storage} from '@wxa/core'; | ||
|
||
export default { | ||
getItem(key) { | ||
return new Promise((r, rj)=>{ | ||
r(storage.get(key)); | ||
}); | ||
}, | ||
setItem(key, string) { | ||
return new Promise((r)=>{ | ||
r(storage.set(key, string)); | ||
}); | ||
}, | ||
removeItem(key) { | ||
return new Promise((r)=>r(storage.remove(key))); | ||
}, | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
var _core = require('@wxa/core'); | ||
|
||
exports.default = { | ||
getItem: function getItem(key) { | ||
return new Promise(function (r, rj) { | ||
r(_core.storage.get(key)); | ||
}); | ||
}, | ||
setItem: function setItem(key, string) { | ||
return new Promise(function (r) { | ||
r(_core.storage.set(key, string)); | ||
}); | ||
}, | ||
removeItem: function removeItem(key) { | ||
return new Promise(function (r) { | ||
return r(_core.storage.remove(key)); | ||
}); | ||
} | ||
}; |
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