mirror of
https://github.com/jaandrle/deka-dom-el
synced 2024-11-22 07:49:38 +01:00
18 lines
483 B
JavaScript
18 lines
483 B
JavaScript
export function isUndef(value){ return typeof value==="undefined"; }
|
|
export function typeOf(v){
|
|
const t= typeof v;
|
|
if(t!=="object") return t;
|
|
if(v===null) return "null";
|
|
return Object.prototype.toString.call(v);
|
|
}
|
|
export function onAbort(signal, listener){
|
|
if(!signal || !(signal instanceof AbortSignal))
|
|
return true;
|
|
if(signal.aborted)
|
|
return;
|
|
signal.addEventListener("abort", listener);
|
|
return function cleanUp(){
|
|
signal.removeEventListener("abort", listener);
|
|
};
|
|
}
|