localforage-find
Adds find function to localforage.
Install and Setup
Works with localforage 1.2.0 or later.
npm install localforage-find
commonjs
const localforage = ;localforage;
es6
import localforage from 'localforage';
import addFind from 'localforage-find';
addFind(localforage);
globals
API
localforage.find(criteria)
localforage.find(criteria, limit)
localforage.find(criteria, callback)
localforage.find(criteria, limit, callback)
- criteria - function that takes (key, value) and returns truthy if value should be in results
- limit - Optional max length of results, defaults to unlimited
- callback - Optional function that takes (error, resultsArray)
Returns Promise fulfilled with Array of results. Array ordering is not guaranteed.
Examples
With Promises
const limit = 2; localforage ;
With callbacks
const limit = 2; localforage;
License
MIT