@rc-component/mutate-observer
React MutateObserver Component
Last updated a year ago by afc163 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @rc-component/mutate-observer 
SYNC missed versions from official npm registry.

@rc-component/mutate-observer

MutateObserver for React.

NPM version npm download build status Codecov bundle size dumi

Development

npm install
npm run start
open http://localhost:8000

Install

@rc-component/mutate-observer

Usage

import React from 'react';
import MutateObserver from 'rc-component/mutate-observer';

const onMutate = (mutations: MutationRecord[], observer: MutationObserver) => {
  console.log(mutation);
  console.log(observer);
};

const Demo: React.FC = () => {
  return (
    <MutateObserver onMutate={onMutate}>
      <div>test</div>
    </MutateObserver>
  );
};

export default Demo;

🔥 API

We use typescript to create the Type definition. You can view directly in IDE. But you can still check the type definition here.

mutate-observer

Prop Description Type Default
onMutate A function which will be called on each DOM change that qualifies given the observed node or subtree and options MutationCallback -
options An object providing options that describe which DOM mutations should be reported to mutationObserver's callback MutationObserverInit -

Current Tags

  • 2.0.1                                ...           latest (a year ago)

5 Versions

  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           2 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.0                                ...           4 years ago
  • 1.0.0-alpha.1                                ...           4 years ago
Downloads
Total 16
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 1
Last Month 1
Dependencies (1)
Dev Dependencies (22)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE