All Projects → ng-web-apis → mutation-observer

ng-web-apis / mutation-observer

Licence: MIT license
A library for idiomatic use of MutationObserver with Angular

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects
Less
1899 projects

Projects that are alternatives of or similar to mutation-observer

state inspector
State change & method call logger. A debugging tool for instance variables and method calls.
Stars: ✭ 24 (-25%)
Mutual labels:  observer, observable
Ease
It's magic.
Stars: ✭ 1,213 (+3690.63%)
Mutual labels:  observer, observable
React Reactive Form
Angular like reactive forms in React.
Stars: ✭ 259 (+709.38%)
Mutual labels:  observer, observable
react-mobx-router5
React components for routing solution using router5 and mobx
Stars: ✭ 58 (+81.25%)
Mutual labels:  observer, observable
reactive-box
1 kB effective reactive core
Stars: ✭ 19 (-40.62%)
Mutual labels:  observer, observable
Observable
The easiest way to observe values in Swift.
Stars: ✭ 346 (+981.25%)
Mutual labels:  observer, observable
Dob
Light and fast 🚀 state management tool using proxy.
Stars: ✭ 713 (+2128.13%)
Mutual labels:  observer, observable
Oba
Observe any object's any change
Stars: ✭ 101 (+215.63%)
Mutual labels:  observer, observable
Receiver
Swift µframework implementing the Observer pattern 📡
Stars: ✭ 238 (+643.75%)
Mutual labels:  observer, observable
Lightweightobservable
📬 A lightweight implementation of an observable sequence that you can subscribe to.
Stars: ✭ 114 (+256.25%)
Mutual labels:  observer, observable
EventEmitter
Simple EventEmitter with multiple listeners
Stars: ✭ 19 (-40.62%)
Mutual labels:  observer, observable
mobx-router5
Router5 integration with mobx
Stars: ✭ 22 (-31.25%)
Mutual labels:  observer, observable
ng-observe
Angular reactivity streamlined...
Stars: ✭ 65 (+103.13%)
Mutual labels:  observer, observable
SwiftObserver
Elegant Reactive Primitives for Clean Swift Architecture #NoRx
Stars: ✭ 14 (-56.25%)
Mutual labels:  observer
uot
🦁 A tiny setTimeout alternative with progress.
Stars: ✭ 43 (+34.38%)
Mutual labels:  observer
vanilla-jsx
Vanilla jsx without runtime. HTML Tag return DOM in js, No virtual DOM.
Stars: ✭ 70 (+118.75%)
Mutual labels:  observable
uon
🐨 A tiny 200b route change observer.
Stars: ✭ 83 (+159.38%)
Mutual labels:  observer
ObservableCollections
Observable Collectons for Android Kotlin apps. Observes adds, deletes etc.
Stars: ✭ 19 (-40.62%)
Mutual labels:  observable
mr-Observer
An observer is a wrapper over JSON data, that provides an interface to know when data is changed, with a focus on performance and memory efficiency.
Stars: ✭ 22 (-31.25%)
Mutual labels:  observer
PowerCollections
Powerfull Collections, Sets, Lists and Maps.
Stars: ✭ 15 (-53.12%)
Mutual labels:  observable

ng-web-apis logo Mutation Observer API for Angular

Part of Web APIs for Angular

npm version npm bundle size Travis (.com) Coveralls github angular-open-source-starter

This is a library for declarative use of Mutation Observer API with Angular.

Install

If you do not have @ng-web-apis/common:

npm i @ng-web-apis/common

Now install the package:

npm i @ng-web-apis/mutation-observer

Usage

Add MutationObserverModule and then use (waMutationObserver)="onMutation($event)" directive to watch mutation in an element.

Alternatively use an Observable-based MutationObserverService manually to get MutationObserver in an RxJS Observable form.

Configuring

Use attributes on an element to define MutationObserverInit config object. All attributes are boolean meaning no need to explicitly set them to true.

NOTE: Keep in mind these are used one time in constructor so you cannot use binding, only strings. Pass comma separated attribute names to set attributeFilter array.

Example

<div
    subtree
    childList
    characterData
    attributeFilter="title, aria-label"
    [title]="title"
    [attr.aria-label]="label"
    (waMutationObserver)="onMutation($event)"
>
    ...
</div>

Browser support

IE / Edge Firefox Chrome Safari
11+ 14+ 26+ 7+

Angular Universal

If you want to use this package with SSR, you need to mock MutationObserver class on the server. You can use our Universal package for this, see this example.

Demo

You can try online demo here

See also

Other Web APIs for Angular by @ng-web-apis

Open-source

Do you also want to open-source something, but hate the collateral work? Check out this Angular Open-source Library Starter we’ve created for our projects. It got you covered on continuous integration, pre-commit checks, linting, versioning + changelog, code coverage and all that jazz.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].