From 04141b66d863775f6abfcde2b87ac1c43af144ea Mon Sep 17 00:00:00 2001 From: Enzo AICARDI Date: Tue, 9 Jul 2024 12:11:56 +0200 Subject: [PATCH] [doc] observer update --- wiki/methods/observe.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/wiki/methods/observe.md b/wiki/methods/observe.md index 2fe3b78..d79199e 100644 --- a/wiki/methods/observe.md +++ b/wiki/methods/observe.md @@ -4,7 +4,7 @@ What is an observer ? useObserve is a Vif method that takes an object as argument. this object has tagNames as keys and functions as values. -When hydrating an x-element, all nested x-elements will be submitted to the observer, if the tagName matches one of the keys, then the associated function will be executed (but only once). +When hydrating an `x-element`, all nested `x-element(s)` will be submitted to the observer, if the `.tagName` matches one of the keys, then the associated function will be executed (only once per key). # Use case @@ -28,10 +28,20 @@ useDefine("app", function () { due to performance concerns --> - + ``` +## Limitations + +There are certain limitations due to the way the observer works : + +- You cannot lazy-load root-level components. +- The style of components is not taken into account by the observer (an invisible component will still be loaded). +- Only components inside `