@visisoft/staticland
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -10,2 +10,4 @@ export type Cancelable<A> = (res: (a: A) => void, rej: (e: any) => void) => (() => void); | ||
export type NodeCallback<A> = (error: Error, result: A) => void; | ||
export function addFantasyLandInterface<A>(ca: Cancelable<A>): Cancelable<A>; | ||
@@ -32,2 +34,5 @@ export function createDeferred<A>(): DeferredCancelable<A>; | ||
// :: Number → ((*..., NodeCallback a) → ()) → *... → Cancelable a | ||
export function fromNodeCallbackWithArity<A>(arity: number, f: (args: [...args: any[], callback: NodeCallback<A>]) => void): (...args: any[]) => Cancelable<A>; | ||
// Transformations | ||
@@ -34,0 +39,0 @@ |
/* @license Apache-2.0 | ||
@visisoft/staticland v.1.1.0 visisoft.de | ||
(Build date: 8/29/2023 - 6:05:07 PM) | ||
@visisoft/staticland v.1.2.0 visisoft.de | ||
(Build date: 8/31/2023 - 1:35:55 PM) | ||
*/ | ||
@@ -936,2 +936,28 @@ 'use strict'; | ||
const fromNodeCallbackWithArity = (arity, callbackComputation) => | ||
ramda.curryN(arity, (...args) => { | ||
const cancelable = (res, rej) => { | ||
let | ||
resolveInner = res, | ||
rejectInner = rej; | ||
callbackComputation(...args, (error, result) => { | ||
if (error) { | ||
rejectInner(error); | ||
} else { | ||
resolveInner(result); | ||
} | ||
}); | ||
return () => { | ||
resolveInner = () => undefined; | ||
rejectInner = () => undefined; | ||
}; | ||
}; | ||
addFantasyLandInterface(cancelable); | ||
return cancelable; | ||
}); | ||
var biTap = ramda.curry((fnf, fns, cc) => fantasticCancelable({ap, chain, map, never, of})( | ||
@@ -1084,2 +1110,3 @@ (resolve, reject) => cc( | ||
exports.fetchResponseIsoModule = fetchResponseIsoModule; | ||
exports.fromNodeCallbackWithArity = fromNodeCallbackWithArity; | ||
exports.later = later; | ||
@@ -1086,0 +1113,0 @@ exports.laterReject = laterReject; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.1.1.0 visisoft.de | ||
(Build date: 8/29/2023 - 6:05:07 PM) | ||
@visisoft/staticland v.1.2.0 visisoft.de | ||
(Build date: 8/31/2023 - 1:35:55 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.1.1.0 visisoft.de | ||
(Build date: 8/29/2023 - 6:05:07 PM) | ||
@visisoft/staticland v.1.2.0 visisoft.de | ||
(Build date: 8/31/2023 - 1:35:55 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.1.1.0 visisoft.de | ||
(Build date: 8/29/2023 - 6:05:07 PM) | ||
@visisoft/staticland v.1.2.0 visisoft.de | ||
(Build date: 8/31/2023 - 1:35:55 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.1.1.0 visisoft.de | ||
(Build date: 8/29/2023 - 6:05:07 PM) | ||
@visisoft/staticland v.1.2.0 visisoft.de | ||
(Build date: 8/31/2023 - 1:35:55 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.1.1.0 visisoft.de | ||
(Build date: 8/29/2023 - 6:05:07 PM) | ||
@visisoft/staticland v.1.2.0 visisoft.de | ||
(Build date: 8/31/2023 - 1:35:55 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.1.1.0 visisoft.de | ||
(Build date: 8/29/2023 - 6:05:07 PM) | ||
@visisoft/staticland v.1.2.0 visisoft.de | ||
(Build date: 8/31/2023 - 1:35:55 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.1.1.0 visisoft.de | ||
(Build date: 8/29/2023 - 6:05:07 PM) | ||
@visisoft/staticland v.1.2.0 visisoft.de | ||
(Build date: 8/31/2023 - 1:35:55 PM) | ||
*/ | ||
@@ -2199,2 +2199,29 @@ 'use strict'; | ||
const | ||
fromNodeCallbackWithArity = (arity, callbackComputation) => | ||
ramda.curryN(arity, (...args) => { | ||
const cancelable = (res, rej) => { | ||
let | ||
resolveInner = res, | ||
rejectInner = rej; | ||
callbackComputation(...args, (error, result) => { | ||
if (error) { | ||
rejectInner(error); | ||
} else { | ||
resolveInner(result); | ||
} | ||
}); | ||
return () => { | ||
resolveInner = () => undefined; | ||
rejectInner = () => undefined; | ||
}; | ||
}; | ||
addFantasyLandInterface(cancelable); | ||
return cancelable; | ||
}); | ||
var biTap = ramda.curry((fnf, fns, cc) => fantasticCancelable({ap, chain, map: map$1, never, of})( | ||
@@ -2352,2 +2379,3 @@ (resolve, reject) => cc( | ||
fetchResponseIsoModule: fetchResponseIsoModule, | ||
fromNodeCallbackWithArity: fromNodeCallbackWithArity, | ||
later: later, | ||
@@ -2354,0 +2382,0 @@ laterReject: laterReject, |
/* @license Apache-2.0 | ||
@visisoft/staticland v.1.1.0 visisoft.de | ||
(Build date: 8/29/2023 - 6:05:07 PM) | ||
@visisoft/staticland v.1.2.0 visisoft.de | ||
(Build date: 8/31/2023 - 1:35:55 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
@@ -106,3 +106,3 @@ { | ||
"type": "module", | ||
"version": "1.1.0" | ||
"version": "1.2.0" | ||
} |
@@ -10,2 +10,4 @@ export type Cancelable<A> = (res: (a: A) => void, rej: (e: any) => void) => (() => void); | ||
export type NodeCallback<A> = (error: Error, result: A) => void; | ||
export function addFantasyLandInterface<A>(ca: Cancelable<A>): Cancelable<A>; | ||
@@ -32,2 +34,5 @@ export function createDeferred<A>(): DeferredCancelable<A>; | ||
// :: Number → ((*..., NodeCallback a) → ()) → *... → Cancelable a | ||
export function fromNodeCallbackWithArity<A>(arity: number, f: (args: [...args: any[], callback: NodeCallback<A>]) => void): (...args: any[]) => Cancelable<A>; | ||
// Transformations | ||
@@ -34,0 +39,0 @@ |
@@ -27,2 +27,3 @@ /** | ||
export {default as cancelifyWithArityAbortable} from './cancelable/cancelifyAbortable.js'; | ||
export {default as fromNodeCallbackWithArity} from './cancelable/fromNodeCallback.js'; | ||
export {default as bi_tap} from './cancelable/biTap.js'; | ||
@@ -29,0 +30,0 @@ export {default as biChain} from './cancelable/biChain.js'; |
289966
125
8243