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