|
il y a 2 ans | |
---|---|---|
.. | ||
dist | il y a 2 ans | |
examples | il y a 2 ans | |
lib | il y a 2 ans | |
test | il y a 2 ans | |
typing-tests | il y a 2 ans | |
typings | il y a 2 ans | |
.babelrc | il y a 2 ans | |
.eslintrc | il y a 2 ans | |
.jscsrc | il y a 2 ans | |
.jshintrc | il y a 2 ans | |
.travis.yml | il y a 2 ans | |
LICENSE | il y a 2 ans | |
README.md | il y a 2 ans | |
bower.json | il y a 2 ans | |
package.json | il y a 2 ans | |
rollup.config.es6.js | il y a 2 ans | |
rollup.config.js | il y a 2 ans | |
rollup.config.test.js | il y a 2 ans | |
rollup.config.umd.js | il y a 2 ans |
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) { });