1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-01 12:22:15 +02:00

Add on.disconnectedAsAbort(), pushRoot() to scope (and 🐛 pop)

This commit is contained in:
2023-11-17 14:48:11 +01:00
parent 5008b56ac8
commit 40780bd61f
11 changed files with 69 additions and 52 deletions

View File

@ -51,6 +51,15 @@ on.disconnected= function(listener, options){
return element;
};
};
const store_abort= new WeakMap();
on.disconnectedAsAbort= function(host){
if(store_abort.has(host)) return store_abort.get(host);
const a= new AbortController();
store_abort.set(host, a);
host(on.disconnected(()=> a.abort()));
return a;
};
on.attributeChanged= function(listener, options){
const name= "attributeChanged";
if(typeof options !== "object")