Skip to content

pantoken-root / formats/scope/src / observeScope

Функція: observeScope() ​

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

Бета

Call listener коли змінюється область, що розв’язується для target, включно з випадками, коли змінюються атрибути предка.

Параметри ​

target ​

Element

listener ​

(scope) => void

Повертає ​

Дія AI.

() => void

Приклад ​

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

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