rxjs-web-observers
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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...
});

Dependencies (1)

Dev Dependencies (17)

Package Sidebar

Install

npm i rxjs-web-observers

Weekly Downloads

234

Version

1.0.2

License

MIT

Unpacked Size

9.26 kB

Total Files

11

Last publish

Collaborators

  • o.mingaleev