Skip to content

olegmingaleev/rxjs-web-observers

Repository files navigation

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

About

rxjs-web-observers

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •