Skip to content

pantoken-root / formats/scope/src / observeScope

Funzione: observeScope() ​

observeScope(target, listener): () => void

Beta

Call listener ogni volta che lo scope risolto per target cambia, incluso quando gli attributi di un antenato cambiano.

Parametri ​

target ​

Element

listener ​

(scope) => void

Restituisce ​

Un'azione AI.

() => void

Esempio ​

ts
import { observeScope } from "@pantoken/scope";

const stop = observeScope(el, (scope) => render(scope.theme, scope.scheme));