{"name":"react-batched-updates","version":"1.0.0","description":"Cross platform unstable_batchedUpdates","author":{"name":"Alec Larson"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/alloc/react-batched-updates.git"},"main":"cjs/index.js","module":"index.js","scripts":{"build":"tsc -p . && tsc -p . --module commonjs --outDir cjs","prepare":"yarn build"},"devDependencies":{"@alloc/prettier-config":"^1.0.0","prettier":"^2.0.5","typescript":"^4.0.0"},"prettier":"@alloc/prettier-config","gitHead":"bf30915426660f1dc69f7a64c911e6a7731cb719","bugs":{"url":"https://github.com/alloc/react-batched-updates/issues"},"homepage":"https://github.com/alloc/react-batched-updates#readme","_id":"react-batched-updates@1.0.0","_nodeVersion":"15.8.0","_npmVersion":"7.5.0","dist":{"integrity":"sha512-DKinb+i+F7TmWKlsR4RMaLMShSIFhlvdGRTD/zMaTNqbhtQzjsmMPrA69jsKML1JlIrqgvFT9spP9DYwxhj+0g==","shasum":"5d3a9243e773762799c65fe42a51ea7a59549df3","tarball":"http://registry-npm.ywwl.com/react-batched-updates/download/react-batched-updates-1.0.0.tgz","fileCount":11,"unpackedSize":7015,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZxw4CRA9TVsSAnZWagAAyBIQAIFwJ85nafvubMi8Z6QR\nzXzkkC/QGo/LACVURMWlFKiIC+ozttyKiLwKt5xls6Tb+o5PbQ/93Dgjsz1j\nGP4wYRdNsbdMzD0CeoWvHl58xZQnqlYMAIajT5Y2WcMTbC9OK97lrZ5F0W0Y\n1aP5nJ57TVACbkPZ1LUE55Pw8GWpDs2AWidSF6koqgJXMgd2vY+laXQYAl9h\ngyqOHUaSyvySQWIzktj6tACxfxpkpp3f+fzEXSYOntkBVYZ36xXnH1Vame4T\nCi20a61uBl2yy+tRfI43BZLMHnC3BlF8ttM0dxg5uTggTMnR9cJC+aKPaQj0\nACOpSE4RGAaK2lfMcBgtbJEL6lY1yXBDsNPU1Fvg/7iH1uPk1erTwgYfjQrJ\nDbdIYZuSAka4HiNtMgjpThV3IASE9tyGQL9vXF7dTap7fPOm2AB/qOcoXz/u\nt2X6C4Sm12iKk+UKWCSUna6QjbPkpK/e2xgQbgUUkUAtgxfBQnh+j3j9LX82\nnJPV0s9WU1YgyQ0U4JJ4W1VYquY15ICPJOkPzI1Yuf67pOR9K1kaCUUCOxCK\nc/5ZVzxzFr1fWkKHhblWZ1Nr1YJ0U/+LsB2tDKkO1s3kc8oQAQ3sKHfeyaUP\nRwtK9rDlfjNeI9LR7DTNAIkfI04s8DjC19d6iLMdnlOxf/G3tcU9RFe5FsVM\nBIP7\r\n=YHkg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICg6QXcpanrMmFQQnh94wtFswagxBDN1I5p2hZRGSZosAiEAh3N/8B2YClA+P797jRlauYWYqGgnMtmiW808b4NaMeI="}],"size":2524,"noattachment":false,"key":"/react-batched-updates/-/react-batched-updates-1.0.0.tgz"},"_npmUser":{"name":"aleclarson","email":"aleclarson@protonmail.com"},"directories":{},"maintainers":[{"name":"aleclarson","email":"aleclarson@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-batched-updates_1.0.0_1617370168263_0.6799705915375376"},"_hasShrinkwrap":false,"readme":"# react-batched-updates\n\n[![npm](https://img.shields.io/npm/v/react-batched-updates.svg)](https://www.npmjs.com/package/react-batched-updates)\n[![Code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/alecdotbiz)\n\n> Cross platform unstable_batchedUpdates\n\n&nbsp;\n\n## Usage\n\n```ts\nimport { batchedUpdates } from 'react-batched-updates'\n\nbatchedUpdates(() => {\n  // Any setState calls are batched, instead of triggering \n  // multiple render passes.\n})\n```\n\nYou should call `setBatchedUpdates` or else `batchedUpdates` will be ineffective. \nExcept for React Native users, where the bundler prefers `cjs/index.native.js`, \na module that requires `react-native` to achieve zero configuration.\n\n```ts\nimport { setBatchedUpdates } from 'react-batched-updates'\nimport { unstable_batchedUpdates } from 'react-dom'\n\n// Both react-native and react-dom have this export.\nsetBatchedUpdates(unstable_batchedUpdates)\n```\n\nIn test environments, you can usually replace `unstable_batchedUpdates` with `act`.\n\n```ts\nimport { setBatchedUpdates } from 'react-batched-updates'\nimport { act } from '@testing-library/react'\n\nsetBatchedUpdates(act)\n```\n","publish_time":1617370168399,"_cnpm_publish_time":1617370168399,"dist-tags":{"latest":"1.1.0"}}