|
hace 2 años | |
---|---|---|
.. | ||
dist | hace 2 años | |
examples | hace 2 años | |
lib | hace 2 años | |
test | hace 2 años | |
typing-tests | hace 2 años | |
typings | hace 2 años | |
.babelrc | hace 2 años | |
.eslintrc | hace 2 años | |
.jscsrc | hace 2 años | |
.jshintrc | hace 2 años | |
.travis.yml | hace 2 años | |
LICENSE | hace 2 años | |
README.md | hace 2 años | |
bower.json | hace 2 años | |
package.json | hace 2 años | |
rollup.config.es6.js | hace 2 años | |
rollup.config.js | hace 2 años | |
rollup.config.test.js | hace 2 años | |
rollup.config.umd.js | hace 2 años |
Adds getItems method to localForage.
npm i localforage-getitems
Just like getItem()
but you can pass an array with the keys that need to be retrieved.
var keys = ['asdf','asap','async'];
localforage.getItems(keys).then(function(results) {
console.log(results);
// prints:
// {
// asdf: 'asdf value!',
// asap: 'asap value!',
// async: 'async value!'
// }
console.log(results.asdf);
console.log(results['asdf']);
console.log(results[keys[0]]);
// all the above print 'asdf value!'
});
Invoking getItems()
without arguments (or with null
as the first argument) will retrieve all the items of the current driver instance.
localforage.getItems().then(function(results) { });
// or by using callbacks
localforage.getItems(null, function(results) { });