mutationObservable()

Observable creation operator

Creates mutation observer and return observable that emits mutation records when the target node is mutated.

Read more about MutationObserver.

This observable has little real world use cases in context of design of Stencil components, however, it is used internally for other operators.

mutationObservable(target, options)

Creates an observable emitting mutation records when the target node is mutated.

function mutationObservable(target: Node, options?: MutationObserverInit): Observable<MutationRecord[]>;
Arguments:
  • target (Node) – The target node to observe for mutations.

  • options (MutationObserverInit) – The options for the mutation observer. See MutationObserverInit for more details.

Returns:

Observable that emits an array of MutationRecord objects when mutations occur.

Return type:

Observable<MutationRecord[]>