Skip to content

Commit f542c1c

Browse files
Fixed issue with PouchDB store
1 parent 261fdf0 commit f542c1c

File tree

6 files changed

+16
-18
lines changed

6 files changed

+16
-18
lines changed

JSDOC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# offline-persistence-toolkit 1.1.0 #
1+
# offline-persistence-toolkit 1.1.1 #
22

33
## Introduction ##
44

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# offline-persistence-toolkit 1.1.0 #
1+
# offline-persistence-toolkit 1.1.1 #
22

33
offline-persistence-toolkit is a client-side JavaScript library that provides caching and offline support at the HTTP request layer. This support is transparent to the user and is done through the Fetch API and an XHR adapter. HTTP requests made while the client device is offline are captured for replay when connection to the server is restored. Additional capabilities include a persistent storage layer, synchronization manager, binary data support and various configuration APIs for customizing the default behavior. This framework can be used in both ServiceWorker and non-ServiceWorker contexts within web and hybrid mobile apps.
44

@@ -58,16 +58,16 @@ If your app uses [RequireJS](http://www.requirejs.org/ "RequireJS"), update the
5858
```javascript
5959
requirejs.config({
6060
paths: {
61-
'persist' : 'js/libs/persist/v1.1.0/min'
61+
'persist' : 'js/libs/persist/v1.1.1/min'
6262

6363
// Other path mappings here
6464
}
6565
```
66-
For Oracle JET apps, also open `appDir/src/js/main-release-paths.json` and add the `'persist' : 'js/libs/persist/v1.1.0/min'` entry to the list of paths.
66+
For Oracle JET apps, also open `appDir/src/js/main-release-paths.json` and add the `'persist' : 'js/libs/persist/v1.1.1/min'` entry to the list of paths.
6767
6868
You can choose the name of the paths prefix. That is, you can use a different value to the ‘persist’ value shown in the examples.
6969
70-
It is recommended to add the version number as a convention in your application build step such as `'persist' : 'js/libs/persist/v1.1.0/min'`.
70+
It is recommended to add the version number as a convention in your application build step such as `'persist' : 'js/libs/persist/v1.1.1/min'`.
7171
7272
The toolkit makes heavy use of the [Promise API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise API"). If you are targeting environments that do not support the Promise API, you will need to polyfill this feature. We recommend the [es6-promise polyfill](https://github.com/stefanpenner/es6-promise "es6-promise polyfill").
7373
@@ -83,7 +83,7 @@ And again, if you are using RequireJS, you will need to map paths for these pack
8383
paths: {
8484
'pouchdb': 'js/libs/pouchdb-6.3.4',
8585
'pouchfind': 'js/libs/pouchdb.find',
86-
'persist' : 'js/libs/persist/v1.1.0/min'
86+
'persist' : 'js/libs/persist/v1.1.1/min'
8787

8888
// Other path mappings here
8989
}

USAGE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# offline-persistence-toolkit 1.1.0 #
1+
# offline-persistence-toolkit 1.1.1 #
22

33
# Introduction #
44

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h3> </h3>
4343

4444

4545
<section>
46-
<article><h1>offline-persistence-toolkit 1.1.0</h1><h2>Introduction</h2><p>This document provides a reference to the offline-persistence-toolkit's JavaScript API. Links to JSDoc for each class can be found to the right.</p>
46+
<article><h1>offline-persistence-toolkit 1.1.1</h1><h2>Introduction</h2><p>This document provides a reference to the offline-persistence-toolkit's JavaScript API. Links to JSDoc for each class can be found to the right.</p>
4747
<p>The toolkit's <a href="https://github.com/oracle/offline-persistence-toolkit/" title="README">README</a> file provides an overview of the toolkit’s capabilities. Having read that document, you can find more information about how to implement a range of common and advanced use cases with the toolkit in the
4848
<a href="https://github.com/oracle/offline-persistence-toolkit/blob/master/USAGE.md" title="Usage guide">Usage guide</a>.</p>
4949
<h2>License</h2><p>Copyright (c) 2017 Oracle and/or its affiliates The Universal Permissive License (UPL), Version 1.0.</p></article>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@oracle/offline-persistence-toolkit",
33
"title": "Offline Persistence Toolkit",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"description": "Offline Persistence Toolkit by Oracle Corp.",
66
"author": "oraclejet",
77
"license": "UPL-1.0",

src/impl/pouchDBPersistenceStore.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,21 +185,19 @@ define(["../PersistenceStore", "../impl/storageUtils", "pouchdb", "./logger"],
185185
// get all rows and use our own find logic
186186
return self._db.allDocs({include_docs: true}).then(function (result) {
187187
if (result && result.rows && result.rows.length) {
188-
var promises = result.rows.map(function(row) {
188+
var satisfiedRows = result.rows.filter(function(row) {
189+
if (storageUtils.satisfy(findExpression.selector, row.doc)) {
190+
return true;
191+
}
192+
return false;
193+
});
194+
var promises = satisfiedRows.map(function(row) {
189195
return self._findResultCallback(modifiedFind.fields).bind(self)(row.doc);
190196
});
191197
return Promise.all(promises);
192198
} else {
193199
return Promise.resolve([]);
194200
}
195-
}).then(function(rows) {
196-
var satisfiedRows = rows.filter(function(row) {
197-
if (storageUtils.satisfy(findExpression.selector, row)) {
198-
return true;
199-
}
200-
return false;
201-
});
202-
return satisfiedRows;
203201
});
204202
}
205203
};

0 commit comments

Comments
 (0)