Angular πŸ‡ΊπŸ‡¦ - practical notes
1.63K subscribers
1.6K photos
1 file
532 links
Angular - practical notes

This group is for posting practical notes for Angular developers. Mostly all posts are for quick implementation https://t.me/angular_practical_notes (Commenting on posts only in ENG and UA langs here). Welcome!
Download Telegram
The MutationObserver interface can monitor changes in the DOM tree and is part of the DOM3 event specification. It can monitor changes in the properties of the current node, changes in child nodes, and so on.

It is particularly important that all Observer event callbacks are microtasks, which has two benefits.

β€” It is asynchronous. It’s not like Mutation Events which fires a synchronous callback every time the DOM changes. Instead, it waits for multiple DOM changes before triggering an asynchronous callback.

β€” It can guarantee real-time, it will definitely be called before the next macro task starts.

#js #MutationObserver

βœ… Link: https://levelup.gitconnected.com/3-web-observers-every-web-developer-should-know-c2f65302b5df
πŸ“„ 6/8 JS Reactive Patterns: Reactive HTML Attributes With MutationObserver

#js #patterns #MutationObserver

One way to achieve reactivity in the DOM is by using MutationObserver. Its API allows us to observe changes in attributes and also in the text content of the target element and its children.