@selkirk-systems/fetch 1.3.0 → 1.4.0

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.
package/dist/Fetch.js CHANGED
@@ -579,8 +579,8 @@ const _fetch = (url, options = {}) => {
579
579
  _cache.delete(url);
580
580
  return Fetch(url, options).then(cacheResponse);
581
581
  }
582
- Fetch(url, options).then(cacheResponse);
583
582
  return unwrapResponseData(response).then(obj => {
583
+ Fetch(url, options).then(cacheResponse);
584
584
  return Promise.resolve([{
585
585
  request: null,
586
586
  response: response,
@@ -57,8 +57,8 @@ export async function fetchPagedURL(url, callback, options) {
57
57
  kiloBytes: kiloBytes,
58
58
  megaBytes: megaBytes
59
59
  };
60
- callback(results);
61
60
  data.items = data._embedded[[Object.keys(data._embedded)[0]]];
61
+ await callback(results, data.items);
62
62
  ret = ret.concat(data.items || []);
63
63
  if (data._links && data._links.next) {
64
64
  const nextUrl = new URL(`${proxyUrl[0]}/p/${data._links.next.href}`);
package/lib/Fetch.js CHANGED
@@ -762,9 +762,8 @@ const _fetch = ( url, options = {} ) => {
762
762
 
763
763
  }
764
764
 
765
- Fetch( url, options ).then( cacheResponse )
766
-
767
765
  return unwrapResponseData( response ).then( ( obj ) => {
766
+ Fetch( url, options ).then( cacheResponse )
768
767
  return Promise.resolve( [{
769
768
  request: null,
770
769
  response: response,
@@ -85,10 +85,10 @@ export async function fetchPagedURL( url, callback, options ) {
85
85
  megaBytes: megaBytes
86
86
  }
87
87
 
88
- callback( results );
89
-
90
88
  data.items = data._embedded[[Object.keys( data._embedded )[0]]];
91
89
 
90
+ await callback( results, data.items );
91
+
92
92
  ret = ret.concat( data.items || [] );
93
93
 
94
94
  if ( data._links && data._links.next ) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selkirk-systems/fetch",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
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": "d981c2a39edb04be17105f9c328942380ccb32f7"
39
+ "gitHead": "29c0902c5e98d9679a6e4dd6977459265875ae2e"
40
40
  }