This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-js/lib/src/native/storage.js

17 lines
539 B
JavaScript
Raw Normal View History

2020-01-03 14:44:51 +08:00
export function storage(context) {
return {
setItem: (key, value, zone) => {
return context.callNative('storage', 'setItem', { key, value, zone });
2020-01-03 14:44:51 +08:00
},
getItem: (key, zone) => {
return context.callNative('storage', 'getItem', { key, zone });
2020-01-03 14:44:51 +08:00
},
remove: (key, zone) => {
return context.callNative('storage', 'remove', { key, zone });
2020-01-03 14:44:51 +08:00
},
clear: (zone) => {
return context.callNative('storage', 'clear', { zone });
2020-01-03 14:44:51 +08:00
},
};
}