@selkirk-systems/fetch 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,8 +87,8 @@ export async function fetchPagedURL(url, callback, options) {
87
87
  results = resultsArray[resultsArray.length - 1];
88
88
  await invokeCallbacks(cachedCallbacks, callback);
89
89
  ret = sortByProp(ret, "id");
90
- ret = ret.reduce((acc, value) => acc.concat(value.items), []);
91
90
  }
91
+ ret = ret.reduce((acc, value) => acc.concat(value.items), []);
92
92
  return [null, ret, {
93
93
  ...results,
94
94
  page: data.page.totalPages
@@ -122,15 +122,14 @@ export async function fetchPagedURL( url, callback, options ) {
122
122
 
123
123
  ret = sortByProp( ret, "id" );
124
124
 
125
- ret = ret.reduce( ( acc, value ) => acc.concat( value.items ), [] );
126
-
127
125
  }
128
126
 
129
-
127
+ ret = ret.reduce( ( acc, value ) => acc.concat( value.items ), [] );
130
128
  return [null, ret, { ...results, page: data.page.totalPages }];
131
129
 
132
130
  }
133
131
 
132
+
134
133
  async function invokeCallbacks( array, callback ) {
135
134
 
136
135
  array = sortByProp( array, "index" );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selkirk-systems/fetch",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Abortable fetch library",
5
5
  "keywords": [],
6
6
  "author": "Marcos Bernal <mbernal@selkirksystems.com>",
@@ -36,5 +36,5 @@
36
36
  "peerDependencies": {
37
37
  "@selkirk-systems/state-management": ">=1.0.0"
38
38
  },
39
- "gitHead": "8287be08e14d942c0162e36c7d9aed13f6ca58b5"
39
+ "gitHead": "97254eb48b612c80120c1285278c8bda7c5b8874"
40
40
  }