1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-04 21:42:14 +02:00

🔤 Improves and updates docs

- customElementRender
- introduction example
This commit is contained in:
2024-12-13 15:01:18 +01:00
parent 3d0aeafc5c
commit e81ac9a3e5
12 changed files with 50 additions and 38 deletions

View File

@ -1,6 +1,7 @@
import { signals } from "./signals-common.js";
import { enviroment as env } from './dom-common.js';
//TODO: add type, docs ≡ make it public
export function queue(promise){ return env.q(promise); }
/** @type {{ scope: object, prevent: boolean, host: function }[]} */
const scopes= [ {

View File

@ -8,6 +8,7 @@ export function dispatchEvent(name, options, host){
d.unshift(element);
element= typeof host==="function"? host() : host;
}
//TODO: what about re-emmitting?
const event= d.length ? new CustomEvent(name, Object.assign({ detail: d[0] }, options)) : new Event(name, options);
return element.dispatchEvent(event);
};