{"name":"@rc-component/mutate-observer","version":"2.0.0","keywords":["react","react-component","mutate-observer"],"author":{"name":"574980606@qq.com"},"license":"MIT","_id":"@rc-component/mutate-observer@2.0.0","maintainers":[{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"afc163","email":"afc163@gmail.com"},{"name":"madccc","email":"1075746765@qq.com"},{"name":"peachscript","email":"scdzwyxst@gmail.com"}],"homepage":"https://github.com/react-component/mutate-observer","bugs":{"url":"https://github.com/react-component/mutate-observer/issues"},"dist":{"shasum":"57caaf9361da06b218e0ca14d9b16e81aa3c1e94","tarball":"http://registry-npm.ywwl.com/@rc-component/mutate-observer/download/@rc-component/mutate-observer-2.0.0.tgz","fileCount":19,"integrity":"sha512-hcHRFgtKAJfqFW+p4qgea4oLuwDxR2oyDY+3VFcZCRuf723Y0ZO2JFzqfDeL0CY+FO+Fs9G+CRg7WFOZjIymtA==","signatures":[{"sig":"MEYCIQCKnyOKxY5nIf5bhJkTQDrdZ8rb7TnlTYD6zikhqJTwTAIhAPoYJNTRiLtnMaGEJ6qnDIJNyc5T1r/psq2QIjoWWX1n","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13086,"size":4145,"noattachment":false,"key":"/@rc-component/mutate-observer/-/@rc-component/mutate-observer-2.0.0.tgz"},"main":"./lib/index","module":"./es/index","engines":{"node":">=8.x"},"gitHead":"f11ce0fc0400008812c9d0395fe992c12f1a34ad","scripts":{"lint":"eslint src/ --ext .tsx,.ts","test":"umi-test","start":"dumi dev","watch":"father dev","deploy":"npm run docs:build && npm run docs:deploy","compile":"father build","prepare":"dumi setup","lint:tsc":"tsc -p tsconfig.json --noEmit","prettier":"prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"","now-build":"npm run docs:build","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","test:coverage":"npm run test --coverage","prepublishOnly":"npm run compile && rc-np"},"typings":"es/index.d.ts","_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"repository":{"url":"git+https://github.com/react-component/mutate-observer.git","type":"git"},"_npmVersion":"10.8.2","description":"React MutateObserver Component","directories":{},"_nodeVersion":"22.5.1","dependencies":{"classnames":"^2.3.2","@rc-component/util":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.0.0","glob":"^10.0.0","react":"^18.0.0","eslint":"^8.54.0","father":"^4.0.0","cheerio":"1.0.0-rc.12","gh-pages":"^3.1.0","prettier":"^2.1.2","umi-test":"^1.9.7","react-dom":"^18.0.0","typescript":"^5.0.0","@types/jest":"^26.0.20","@types/node":"^22.10.7","@types/react":"^19.0.7","@umijs/fabric":"^3.0.0","@rc-component/np":"^1.0.3","@types/react-dom":"^19.0.3","eslint-plugin-jest":"^27.6.0","eslint-plugin-unicorn":"^49.0.0","@testing-library/react":"^13.0.0","@testing-library/jest-dom":"^5.16.4","@rc-component/father-plugin":"^2.0.2"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"_npmOperationalInternal":{"tmp":"tmp/mutate-observer_2.0.0_1737714961244_0.6842253833879859","host":"s3://npm-registry-packages-npm-production"},"readme":"# @rc-component/mutate-observer\n\nMutateObserver for React.\n\n\n[![NPM version][npm-image]][npm-url]\n[![npm download][download-image]][download-url]\n[![build status][github-actions-image]][github-actions-url]\n[![Codecov][codecov-image]][codecov-url]\n[![bundle size][bundlephobia-image]][bundlephobia-url]\n[![dumi][dumi-image]][dumi-url]\n\n[npm-image]: https://img.shields.io/npm/v/@rc-component/mutate-observer.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/@rc-component/mutate-observer\n[github-actions-image]: https://github.com/react-component/mutate-observer/actions/workflows/main.yml/badge.svg\n[github-actions-url]: https://github.com/react-component/mutate-observer/actions/workflows/main.yml\n[codecov-image]: https://img.shields.io/codecov/c/github/react-component/mutate-observer/master.svg?style=flat-square\n[codecov-url]: https://app.codecov.io/gh/react-component/mutate-observer\n[david-url]: https://david-dm.org/react-component/mutate-observer\n[david-image]: https://david-dm.org/react-component/mutate-observer/status.svg?style=flat-square\n[david-dev-url]: https://david-dm.org/react-component/mutate-observer?type=dev\n[david-dev-image]: https://david-dm.org/react-component/mutate-observer/dev-status.svg?style=flat-square\n[download-image]: https://img.shields.io/npm/dm/@rc-component/mutate-observer.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@rc-component/mutate-observer\n[bundlephobia-url]: https://bundlephobia.com/package/@rc-component/mutate-observer\n[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/mutate-observer\n[dumi-url]: https://github.com/umijs/dumi\n[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square\n\n## Development\n\n```bash\nnpm install\nnpm run start\nopen http://localhost:8000\n```\n\n## Install\n\n[![@rc-component/mutate-observer](https://nodei.co/npm/@rc-component/mutate-observer.png)](https://www.npmjs.com/package/@rc-component/mutate-observer)\n\n## Usage\n\n```tsx | pure\nimport React from 'react';\nimport MutateObserver from 'rc-component/mutate-observer';\n\nconst onMutate = (mutations: MutationRecord[], observer: MutationObserver) => {\n  console.log(mutation);\n  console.log(observer);\n};\n\nconst Demo: React.FC = () => {\n  return (\n    <MutateObserver onMutate={onMutate}>\n      <div>test</div>\n    </MutateObserver>\n  );\n};\n\nexport default Demo;\n```\n\n## 🔥 API\n\nWe use typescript to create the Type definition. You can view directly in IDE. But you can still check the type definition [here](https://github.com/react-component/mutate-observer/blob/master/src/interface.ts).\n\n### mutate-observer\n\n| Prop     | Description                                                                                                      | Type                 | Default |\n| -------- | ---------------------------------------------------------------------------------------------------------------- | -------------------- | ------- |\n| onMutate | A function which will be called on each DOM change that qualifies given the observed node or subtree and options | MutationCallback     | -       |\n| options  | An object providing options that describe which DOM mutations should be reported to mutationObserver's callback  | MutationObserverInit | -       |\n","publish_time":1737714961452,"_cnpm_publish_time":1737714961452,"dist-tags":{"latest":"2.0.1"}}