1.0.2 • Published 4 years ago

rxjs-web-observers v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

rxjs-web-observers

npm version npm bundle size Build Status License

This library allows you to use MutationObserver, IntersectionObserver, ResizeObserver like RxJs observer.

Install

npm install --save rxjs-web-observers

Polyfills

Recommended polyfills:

Usage

Creating MutationObserver from call fromMutation function:

import { fromMutation } from 'rxjs-web-observers';

const source$ = fromMutation(
    observedEl, // some observed element
    { childList: true } // observer options
);

source$.subscribe(mutations => {
    // your code...
});

Creation IntersectionObserver by fromIntersection function:

import { fromIntersection } from 'rxjs-web-observers';

const source$ = fromIntersection(
    observedEl, // some observed element
);

source$.subscribe(entries => {
    // your code...
});

Creation ResizeObserver by fromResize function:

import { fromResize } from 'rxjs-web-observers';

const source$ = fromResize(
    observedEl, // some observed element
);

source$.subscribe(entries => {
    // your code...
});