{"name":"react-batched-updates","version":"1.1.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","module":"index.js","exports":{"import":{"browser":"./index.web.js","default":"./index.js"},"default":"./cjs/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":"187dae5d4c727cc4cf7475f4f85c9a14c3e74bd3","bugs":{"url":"https://github.com/alloc/react-batched-updates/issues"},"homepage":"https://github.com/alloc/react-batched-updates#readme","_id":"react-batched-updates@1.1.0","_nodeVersion":"16.5.0","_npmVersion":"7.19.1","dist":{"integrity":"sha512-oE8oMUKp4oPfJz0NS7+2wYxW2bnih2BynbXMgyNwtoJhs48bEcpoXG2b/Jy0FUddHHZOpUGkwgc4S04TecfA1A==","shasum":"b3239de3d9e1ee3c4f7ae9e0ad6ab875f76f307f","tarball":"http://registry-npm.ywwl.com/react-batched-updates/download/react-batched-updates-1.1.0.tgz","fileCount":12,"unpackedSize":7243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEtg4CRA9TVsSAnZWagAAzucP/0j7XrCXapp0OSKfRDV5\nvO3Bo1VpontmF53DRMfRqzH7Gwj7pwmx5VeZQALafPA2v2MQw0T2r6Jge5iA\nkaRNPCdb3gQvPvpNAP7tcfK8O41DYGHDE29TQDoORI09CoiqG3DF8bKRql/u\nDhOPzEMohbUp58NF6PhOLRlnjXiKYEoEJ/R6W8aN07+Y9RhnbVmyvL+67AO1\nNCQrlBsETordnf8+9sccuXc10NfLGNOi6Whd0Oat7TZPO/++Pd5aD/drzHOG\nA5qZnA2l/XVCVyup3M2rb92MZDEMyzLx1GSYEIc8iwrZE1WoS9bN6g/4Fj/a\ne9Fuyrb2P1b0FspvZGW2bHCHAy4C0XS2Gta9jR2/FtPa8xevk5J3MhaBmXxP\nwmu7h51g3aisb1GIirM3gvWunX/NmluJOWfyUeOgXrFb/bCq7xIMH8AlqdCS\n+cw6QRqieO2Nh8zs0BPyYuQXLe2oPNEAhHdBeYxu1fMZYxzquHaf9oTZTOOy\nRl2Xm8+aXwG3RwpLLEtyB9bVIr8LEtxFOx5PE0o1dxWl8vnESFhZBtyCgR9F\nNBdnVN0n6vAZnTuhL9c5jIdmqLNEMSpJZg+HGepQHbXFRhxIgXKl8B9tIHq8\n855il4cvKjggQ2Q9UG1iW7Vga1pgc8261zYXZfUwDGPuqpRDDVMuPZosSMVE\nNmR/\r\n=qBxQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/hBbd1K3n77B0fRHPfp/FIGu+sXaELN02TQq89cv5qAIgRbr53u2lFe30sIKs9ys7BwX0ekgsU+oNeHCXNjSyCo8="}],"size":2577,"noattachment":false,"key":"/react-batched-updates/-/react-batched-updates-1.1.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.1.0_1628624952040_0.5291965653599289"},"_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":1628624952169,"_cnpm_publish_time":1628624952169,"dist-tags":{"latest":"1.1.0"}}