From 3fc585d012fb9a817b95822c468225ad6b286fe6 Mon Sep 17 00:00:00 2001 From: Jan Andrle Date: Mon, 4 Dec 2023 18:28:18 +0100 Subject: [PATCH] :memo: update scopes documentation --- docs/p05-scopes.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/p05-scopes.html b/docs/p05-scopes.html index cc87757..0171ca0 100644 --- a/docs/p05-scopes.html +++ b/docs/p05-scopes.html @@ -115,7 +115,7 @@ function component(){ }); return el("p", textContent, onclickChange); } -

The text content of the paragraph is changing when the value of the observable textContent is changed. Internally, there is association between textContent and the paragraph similar to using S.on(textContent, /* update the paragraph */).

This listener must be removed when the component is removed from the DOM. To do it, the library assign internally on.disconnect(/* remove the listener */)(host()) to the host element.

The library DOM API and observables works ideally when used declaratively. It means, you split your app logic into three parts as it was itroduced in Observables.

/* PSEUDO-CODE!!! */ +

The text content of the paragraph is changing when the value of the observable textContent is changed. Internally, there is association between textContent and the paragraph similar to using S.on(textContent, /* update the paragraph */).

This listener must be removed when the component is removed from the DOM. To do it, the library assign internally on.disconnected(/* remove the listener */)(host()) to the host element.

The library DOM API and observables works ideally when used declaratively. It means, you split your app logic into three parts as it was itroduced in Observables.

/* PSEUDO-CODE!!! */ import { el } from "deka-dom-el"; import { O } from "deka-dom-el/observables"; function component(){