{"name":"@rc-component/mutate-observer","version":"2.0.1","description":"React MutateObserver Component","keywords":["react","react-component","mutate-observer"],"homepage":"https://github.com/react-component/mutate-observer","bugs":{"url":"https://github.com/react-component/mutate-observer/issues"},"repository":{"type":"git","url":"git+https://github.com/react-component/mutate-observer.git"},"license":"MIT","author":{"name":"574980606@qq.com"},"main":"./lib/index","module":"./es/index","typings":"es/index.d.ts","scripts":{"compile":"father build","deploy":"npm run docs:build && npm run docs:deploy","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","lint":"eslint src/ --ext .tsx,.ts","lint:tsc":"tsc -p tsconfig.json --noEmit","now-build":"npm run docs:build","prepare":"dumi setup","prepublishOnly":"npm run compile && rc-np","prettier":"prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"","start":"dumi dev","test":"umi-test","test:coverage":"npm run test --coverage","watch":"father dev"},"dependencies":{"@rc-component/util":"^1.2.0"},"devDependencies":{"@rc-component/father-plugin":"^2.0.2","@rc-component/np":"^1.0.3","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.0.0","@types/jest":"^26.0.20","@types/node":"^22.10.7","@types/react":"^19.0.7","@types/react-dom":"^19.0.3","@umijs/fabric":"^3.0.0","cheerio":"1.0.0-rc.12","dumi":"^2.0.0","eslint":"^8.54.0","eslint-plugin-jest":"^27.6.0","eslint-plugin-unicorn":"^49.0.0","father":"^4.0.0","gh-pages":"^3.1.0","glob":"^10.0.0","prettier":"^2.1.2","react":"^18.0.0","react-dom":"^18.0.0","typescript":"^5.0.0","umi-test":"^1.9.7"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"engines":{"node":">=8.x"},"_id":"@rc-component/mutate-observer@2.0.1","gitHead":"5455ccbb133ad5db622b1888e32b424108feeacf","_nodeVersion":"22.8.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-AyarjoLU5YlxuValRi+w8JRH2Z84TBbFO2RoGWz9d8bSu0FqT8DtugH3xC3BV7mUwlmROFauyWuXFuq4IFbH+w==","shasum":"78f54a23bff7c62b2137dfb67e063c1be6ac0652","tarball":"http://registry-npm.ywwl.com/@rc-component/mutate-observer/download/@rc-component/mutate-observer-2.0.1.tgz","fileCount":19,"unpackedSize":13829,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFN4iFnFd3PIoRkrZQVUCEM+s7YyjRmIyu/AUW5wY0ssAiAez198FDHJtbYa/4Hv58RiW1u7ZzmVTpNhf1ckdYB2Xg=="}],"size":4286,"noattachment":false,"key":"/@rc-component/mutate-observer/-/@rc-component/mutate-observer-2.0.1.tgz"},"_npmUser":{"name":"afc163","email":"afc163@gmail.com"},"directories":{},"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"},{"name":"chenshuai2144","email":"wasd2144@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mutate-observer_2.0.1_1764298962123_0.7670633499731787"},"_hasShrinkwrap":false,"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":1764298962339,"_cnpm_publish_time":1764298962339,"dist-tags":{"latest":"2.0.1"}}