lib/client/lib/localforage/localforage.js
function iterate(iterator, callback) {
        var self = this;

        var promise = new Promise(function(resolve, reject) {
            self.ready().then(function() {
                var dbInfo = self._dbInfo;
                var store = dbInfo.db.transaction(dbInfo.storeName, 'readonly')
                                     .objectStore(dbInfo.storeName);

                var req = store.openCursor();

                req.onsuccess = function() {
                    var cursor = req.result;

                    if (cursor) {
                        var result = iterator(cursor.value, cursor.key);

                        if (result !== void(0)) {
                            resolve(result);
                        } else {
                            cursor["continue"]();
                        }
                    } else {
                        resolve();
                    }
                };

                req.onerror = function() {
                    reject(req.error);
                };
            })["catch"](reject);
        });

        executeDeferedCallback(promise, callback);

        return promise;
    }
function iterate(iterator, callback) {
        var self = this;

        var promise = new Promise(function(resolve, reject) {
            self.ready().then(function() {
                var dbInfo = self._dbInfo;
                var store = dbInfo.db.transaction(dbInfo.storeName, 'readonly')
                                     .objectStore(dbInfo.storeName);

                var req = store.openCursor();

                req.onsuccess = function() {
                    var cursor = req.result;

                    if (cursor) {
                        var result = iterator(cursor.value, cursor.key);

                        if (result !== void(0)) {
                            resolve(result);
                        } else {
                            cursor["continue"]();
                        }
                    } else {
                        resolve();
                    }
                };

                req.onerror = function() {
                    reject(req.error);
                };
            })["catch"](reject);
        });

        executeDeferedCallback(promise, callback);

        return promise;
    }
function iterate ( iterator , callback ) { var self = this ; var promise = new Promise ( function ( resolve , reject ) { self . ready ( ) . then ( function ( ) { var dbInfo = self . _dbInfo ; var store = dbInfo . db . transaction ( dbInfo . storeName , 'readonly' ) . objectStore ( dbInfo . storeName ) ; var req = store . openCursor ( ) ; req . onsuccess = function ( ) { var cursor = req . result ; if ( cursor ) { var result = iterator ( cursor . value , cursor . key ) ; if ( result !== void ( 0 ) ) { resolve ( result ) ; } else { cursor [ "continue" ] ( ) ; } } else { resolve ( ) ; } } ; req . onerror = function ( ) { reject ( req . error ) ; } ; } ) [ "catch" ] ( reject ) ; } ) ; executeDeferedCallback ( promise , callback ) ; return promise ; }
Iterate over all items stored in database.
Iterate over all items stored in database .