@visisoft/staticland
Advanced tools
Comparing version 0.1.30 to 0.1.31
@@ -12,4 +12,7 @@ export type Cancelable<A> = (res: (a: A) => void, rej: (e: any) => void) => (() => void); | ||
/** @deprecated */ | ||
export function fetchResponse({url, spec}: {url: URL|string, spec: RequestInit}): Cancelable<Response>; | ||
export function fetchResponseIsoModule(spec: WindowOrWorkerGlobalScope): ({url, spec}: {url: URL|string, spec: RequestInit}) => Cancelable<Response>; | ||
export function cancelify<A>(f: (...args: any[]) => Promise<A>): (...args: any[]) => Cancelable<A>; | ||
@@ -16,0 +19,0 @@ |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.30 visisoft.de | ||
(Build date: 12/1/2021 - 8:22:17 PM) | ||
@visisoft/staticland v.0.1.31 visisoft.de | ||
(Build date: 12/1/2021 - 10:00:30 PM) | ||
*/ | ||
@@ -156,2 +156,3 @@ 'use strict'; | ||
/** | ||
* @deprecated | ||
* @param {Object} options | ||
@@ -158,0 +159,0 @@ * @param {String|URL} options.url |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.30 visisoft.de | ||
(Build date: 12/1/2021 - 8:22:17 PM) | ||
@visisoft/staticland v.0.1.31 visisoft.de | ||
(Build date: 12/1/2021 - 10:00:30 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.30 visisoft.de | ||
(Build date: 12/1/2021 - 8:22:17 PM) | ||
@visisoft/staticland v.0.1.31 visisoft.de | ||
(Build date: 12/1/2021 - 10:00:30 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.30 visisoft.de | ||
(Build date: 12/1/2021 - 8:22:17 PM) | ||
@visisoft/staticland v.0.1.31 visisoft.de | ||
(Build date: 12/1/2021 - 10:00:30 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.30 visisoft.de | ||
(Build date: 12/1/2021 - 8:22:17 PM) | ||
@visisoft/staticland v.0.1.31 visisoft.de | ||
(Build date: 12/1/2021 - 10:00:30 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.30 visisoft.de | ||
(Build date: 12/1/2021 - 8:22:17 PM) | ||
@visisoft/staticland v.0.1.31 visisoft.de | ||
(Build date: 12/1/2021 - 10:00:30 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.30 visisoft.de | ||
(Build date: 12/1/2021 - 8:22:17 PM) | ||
@visisoft/staticland v.0.1.31 visisoft.de | ||
(Build date: 12/1/2021 - 10:00:30 PM) | ||
*/ | ||
@@ -874,3 +874,33 @@ 'use strict'; | ||
/*** | ||
* Iso version for the browser or Node.js | ||
*/ | ||
const | ||
/** | ||
* @type {(spec: WindowOrWorkerGlobalScope) => (spec: {[key: string]: any}) => import('@visisoft/staticland/cancelable').Cancelable<Response>} | ||
*/ | ||
// fetchResponse :: {url: (String|URL), init: {}} -> Cancelable Error Response | ||
fetchResponseIsoModule = ({fetch, AbortController}) => | ||
({url, init = {}}) => (resolve, reject) => { | ||
const | ||
abortController = new AbortController(), | ||
cancelPromiseContinuation = | ||
promiseToCancelable( | ||
fetch( | ||
url.toString(), | ||
{...init, signal: abortController.signal} | ||
) | ||
)(resolve, reject); | ||
return () => { | ||
cancelPromiseContinuation(); | ||
abortController.abort(); | ||
}; | ||
}; | ||
const | ||
cancelify = fn => semmelRamda.curryN(fn.length, (...args) => | ||
@@ -907,2 +937,3 @@ (res, rej) => { | ||
fetchResponse: fetchResponse, | ||
fetchResponseIsoModule: fetchResponseIsoModule, | ||
cancelify: cancelify | ||
@@ -909,0 +940,0 @@ }); |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.30 visisoft.de | ||
(Build date: 12/1/2021 - 8:22:17 PM) | ||
@visisoft/staticland v.0.1.31 visisoft.de | ||
(Build date: 12/1/2021 - 10:00:30 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
@@ -100,3 +100,3 @@ { | ||
"type": "module", | ||
"version": "0.1.30" | ||
"version": "0.1.31" | ||
} |
@@ -12,4 +12,7 @@ export type Cancelable<A> = (res: (a: A) => void, rej: (e: any) => void) => (() => void); | ||
/** @deprecated */ | ||
export function fetchResponse({url, spec}: {url: URL|string, spec: RequestInit}): Cancelable<Response>; | ||
export function fetchResponseIsoModule(spec: WindowOrWorkerGlobalScope): ({url, spec}: {url: URL|string, spec: RequestInit}) => Cancelable<Response>; | ||
export function cancelify<A>(f: (...args: any[]) => Promise<A>): (...args: any[]) => Cancelable<A>; | ||
@@ -16,0 +19,0 @@ |
@@ -15,2 +15,3 @@ /** | ||
export {default as fetchResponse} from './cancelable/fetchResponse.js'; | ||
export {default as fetchResponseIsoModule} from './cancelable/fetchResponseIsoModule.js'; | ||
export {default as cancelify} from './cancelable/cancelify.js'; |
@@ -11,2 +11,3 @@ /*** | ||
/** | ||
* @deprecated | ||
* @param {Object} options | ||
@@ -13,0 +14,0 @@ * @param {String|URL} options.url |
150167
89
3873
6