diff --git a/storages/localStorage.js b/storages/localStorage.js index 09fe08c9..288025e2 100644 --- a/storages/localStorage.js +++ b/storages/localStorage.js @@ -10,29 +10,26 @@ module.exports = { clearAll: clearAll, } -function localStorage() { - return Global.localStorage -} - +var localStorage = Global.localStorage; function read(key) { - return localStorage().getItem(key) + return localStorage.getItem(key) } function write(key, data) { - return localStorage().setItem(key, data) + return localStorage.setItem(key, data) } function each(fn) { - for (var i = localStorage().length - 1; i >= 0; i--) { - var key = localStorage().key(i) + for (var i = localStorage.length - 1; i >= 0; i--) { + var key = localStorage.key(i) fn(read(key), key) } } function remove(key) { - return localStorage().removeItem(key) + return localStorage.removeItem(key) } function clearAll() { - return localStorage().clear() + return localStorage.clear() }