The provided subscription get owned by the element:
it will be unsubscribed when the element is removed from the DOM.
Typically:
letclicked$ = newrxjs.BehaviorSubject({clicked:false})letvDOM = {tag:'div',connectedCallback: (elem: HTMLElement$) => {// the ownership of sub0 is given to the VirtualDOM// => it will be unsubscribed when element is actually removed from the viewelem.ownSubscription(clicked$.subscribe( (d) =>console.log(d))) }children: [ {tag:'button',innerText:'hello flux view',onclick: () =>clicked$.next({clicked:true}) }]}
The provided subscription get owned by the element: it will be unsubscribed when the element is removed from the DOM.
Typically: