1. localforage-getitems
Adds getItems method to localForage.
localforage-getitems
Package: localforage-getitems
Created by: thgreasi
Last modified: Sun, 19 Jun 2022 13:21:02 GMT
Version: 1.4.2
Downloads: 7,381
Repository: https://github.com/thgreasi/localForage-getItems

Install

npm install localforage-getitems
yarn add localforage-getitems

localForage-getItems

npm
Adds getItems method to localForage.

Requirements

  • localForage v1.4.0+
    • for earlier versions of localforage, please use the v1.1.x releases

Installation

npm i localforage-getitems

API

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) { });

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin