1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-01 12:22:15 +02:00
This commit is contained in:
2025-03-06 11:42:56 +01:00
parent 66fdee2c05
commit 6c297672c1
4 changed files with 262 additions and 5 deletions

View File

@ -95,8 +95,8 @@ const store_abort= new WeakMap();
/**
* Creates an AbortController that triggers when the element disconnects
*
* @param {Element|Function} host - Host element or function taking an element
* @returns {AbortController} AbortController that aborts on disconnect
* @param {Function} host - Host element or function taking an element
* @returns {AbortSignal} AbortSignal that aborts on disconnect
*/
on.disconnectedAsAbort= function(host){
if(store_abort.has(host)) return store_abort.get(host);
@ -104,7 +104,7 @@ on.disconnectedAsAbort= function(host){
const a= new AbortController();
store_abort.set(host, a);
host(on.disconnected(()=> a.abort()));
return a;
return a.signal;
};
/** Store for elements with attribute observers */