Skip to content

Commit

Permalink
0.0.63
Browse files Browse the repository at this point in the history
  • Loading branch information
bahrus committed Jun 2, 2024
1 parent 1378e75 commit 60a0d86
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions be-based.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class BeBased extends BE {
}
}
};
#mo;
hydrate(self) {
const { forAll, base, fileName, enhancedElement } = self;
if (!base.endsWith('/')) {
Expand All @@ -34,6 +35,7 @@ export class BeBased extends BE {
}
});
mo.observe(enhancedElement);
this.#mo = mo;
return {
resolved: true,
};
Expand Down Expand Up @@ -65,4 +67,11 @@ export class BeBased extends BE {
}
node.setAttribute(attrib, newVal);
}
disconnect(el) {
if (this.#mo !== undefined)
this.#mo.disconnect(el);
}
async detach(el) {
this.disconnect(el);
}
}
8 changes: 8 additions & 0 deletions be-based.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class BeBased extends BE<Element> implements Actions{
}
}
};
#mo: MountObserver | undefined;
hydrate(self: this): PAP {
const {forAll, base, fileName, enhancedElement} = self;
if(!base!.endsWith('/')){
Expand All @@ -37,6 +38,7 @@ export class BeBased extends BE<Element> implements Actions{
}
});
mo.observe(enhancedElement);
this.#mo = mo;
return {
resolved: true,
}
Expand All @@ -63,6 +65,12 @@ export class BeBased extends BE<Element> implements Actions{
}
(node as Element).setAttribute(attrib, newVal);
}
disconnect(el: Element){
if(this.#mo !== undefined) this.#mo.disconnect(el)
}
override async detach(el: Element) {
this.disconnect(el);
}
}

export interface BeBased extends AllProps{}

0 comments on commit 60a0d86

Please sign in to comment.