mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-04-11 23:25:34 +02:00
⚡ asyncQueue
This commit is contained in:
parent
c085f268e8
commit
89553383bb
6
jsdom.js
6
jsdom.js
@ -1,6 +1,12 @@
|
|||||||
//TODO: https://www.npmjs.com/package/html-element
|
//TODO: https://www.npmjs.com/package/html-element
|
||||||
import { enviroment as env } from './src/dom-common.js';
|
import { enviroment as env } from './src/dom-common.js';
|
||||||
env.ssr= " ssr";
|
env.ssr= " ssr";
|
||||||
|
|
||||||
|
const wa_store= new Set();
|
||||||
|
env.qa= function(promise){ wa_store.add(promise); return promise; };
|
||||||
|
env.qw= function(){ return Promise.allSettled(Array.from(wa_store)).then(()=> wa_store.clear()); };
|
||||||
|
export const asyncQueue= env.ww;
|
||||||
|
|
||||||
const { setDeleteAttr }= env;
|
const { setDeleteAttr }= env;
|
||||||
/** @param {HTMLElement} obj */
|
/** @param {HTMLElement} obj */
|
||||||
env.setDeleteAttr= function(obj, prop, value){
|
env.setDeleteAttr= function(obj, prop, value){
|
||||||
|
@ -6,6 +6,8 @@ export const enviroment= {
|
|||||||
H: globalThis.HTMLElement,
|
H: globalThis.HTMLElement,
|
||||||
S: globalThis.SVGElement,
|
S: globalThis.SVGElement,
|
||||||
M: globalThis.MutationObserver,
|
M: globalThis.MutationObserver,
|
||||||
|
qa: (p)=> p,
|
||||||
|
qw: ()=> Promise.resolve(),
|
||||||
};
|
};
|
||||||
import { isUndef } from './helpers.js';
|
import { isUndef } from './helpers.js';
|
||||||
function setDeleteAttr(obj, prop, val){
|
function setDeleteAttr(obj, prop, val){
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { signals } from "./signals-common.js";
|
import { signals } from "./signals-common.js";
|
||||||
import { enviroment as env } from './dom-common.js';
|
import { enviroment as env } from './dom-common.js';
|
||||||
|
|
||||||
|
export function asyncQueueAdd(promise){ return env.qa(promise); }
|
||||||
/** @type {{ scope: object, prevent: boolean, host: function }[]} */
|
/** @type {{ scope: object, prevent: boolean, host: function }[]} */
|
||||||
const scopes= [ {
|
const scopes= [ {
|
||||||
get scope(){ return env.D.body; },
|
get scope(){ return env.D.body; },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user