{"_id":"redux-batched-subscribe","_rev":"11-edba2cd88e6c2b976d16c6c9337d8383","name":"redux-batched-subscribe","description":"redux store enhancer which allows batching subscribe notifications.","dist-tags":{"latest":"0.1.6"},"versions":{"0.1.0":{"name":"redux-batched-subscribe","version":"0.1.0","description":"higher order redux store which allows batching subscribe notifications.","main":"lib/index.js","scripts":{"test":"make test","prepublish":"make clean build"},"keywords":["redux","batched","react","reactjs","performance","store"],"author":{"name":"Terry Appleby","email":"terry.appleby@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/tappleby/redux-batched-subscribe/issues"},"homepage":"https://github.com/tappleby/redux-batched-subscribe","devDependencies":{"babel":"^5.8.20","babel-core":"^5.8.20","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.0.0","eslint-config-airbnb":"0.0.7","eslint-plugin-react":"^3.1.0","jsdom":"^5.6.0","mocha":"^2.2.5","sinon":"^1.15.4"},"dependencies":{"invariant":"^2.1.0"},"gitHead":"998eee395196b72410c4f247146737a8b43e6e1e","_id":"redux-batched-subscribe@0.1.0","_shasum":"ce1dfd1e97a85cbb8d85775e7c6c3a1161360381","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"tappleby","email":"terry.appleby@gmail.com"},"dist":{"shasum":"ce1dfd1e97a85cbb8d85775e7c6c3a1161360381","tarball":"https://registry.npmjs.org/redux-batched-subscribe/-/redux-batched-subscribe-0.1.0.tgz","integrity":"sha512-qlHCGqr/c+301rWcS9lEleT1xsJhWah2hPKtXbAwO8poE4mtmlvdrkrYujMsThQ/gbOP0FOo+OTpRNUWSXQNXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYpmci9QlOvIt8M1sK83WgXURHTx1cjmdPGavtpolEugIgNHj0xSkgnsFYiP5PDSSt6/ZT8VySkMfKoKf+nXFw4pE="}]},"maintainers":[{"name":"tappleby","email":"terry.appleby@gmail.com"}]},"0.1.1":{"name":"redux-batched-subscribe","version":"0.1.1","description":"higher order redux store which allows batching subscribe notifications.","main":"lib/index.js","scripts":{"test":"make test","prepublish":"make clean build"},"keywords":["redux","batched","react","reactjs","performance","store"],"author":{"name":"Terry Appleby","email":"terry.appleby@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/tappleby/redux-batched-subscribe.git"},"bugs":{"url":"https://github.com/tappleby/redux-batched-subscribe/issues"},"homepage":"https://github.com/tappleby/redux-batched-subscribe","devDependencies":{"babel":"^5.8.20","babel-core":"^5.8.20","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.0.0","eslint-config-airbnb":"0.0.7","eslint-plugin-react":"^3.1.0","jsdom":"^5.6.0","mocha":"^2.2.5","sinon":"^1.15.4"},"dependencies":{"invariant":"^2.1.0"},"gitHead":"f70a6a2326656a1b1a3c32364b22f09d6cfe6078","_id":"redux-batched-subscribe@0.1.1","_shasum":"0fdb1961feecd7ed66c2bdeb4f94418141d1fb2e","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"tappleby","email":"terry.appleby@gmail.com"},"dist":{"shasum":"0fdb1961feecd7ed66c2bdeb4f94418141d1fb2e","tarball":"https://registry.npmjs.org/redux-batched-subscribe/-/redux-batched-subscribe-0.1.1.tgz","integrity":"sha512-Em1WyjFnZU2BBi4cx5tEwQgA+HBfex5odD5vcLc56KLz584ndOxhaazZX/gfY6+Am6LKz3wdN/l8PCqhO0gCkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGwL1spy4IveIKZdTdLIjjlmeH9G+GPD8ZR8teDka2zWAiBkXggV4sSNFWwpxMO6Wcet7MDKL1KPzleVlt9lFwdTaA=="}]},"maintainers":[{"name":"tappleby","email":"terry.appleby@gmail.com"}]},"0.1.2":{"name":"redux-batched-subscribe","version":"0.1.2","description":"redux store enhancer which allows batching subscribe notifications.","main":"lib/index.js","scripts":{"test":"make test","prepublish":"make clean build"},"keywords":["redux","batched","react","reactjs","performance","store"],"author":{"name":"Terry Appleby","email":"terry.appleby@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/tappleby/redux-batched-subscribe.git"},"bugs":{"url":"https://github.com/tappleby/redux-batched-subscribe/issues"},"homepage":"https://github.com/tappleby/redux-batched-subscribe","devDependencies":{"babel":"^5.8.20","babel-core":"^5.8.20","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.0.0","eslint-config-airbnb":"0.0.7","eslint-plugin-react":"^3.1.0","jsdom":"^5.6.0","mocha":"^2.2.5","sinon":"^1.15.4"},"dependencies":{"invariant":"^2.1.0"},"gitHead":"19fe47997e00e4469361ef489e3c357595a706d0","_id":"redux-batched-subscribe@0.1.2","_shasum":"1c050d94740196ff6f5a079e89a90e9901faebe0","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"tappleby","email":"terry.appleby@gmail.com"},"dist":{"shasum":"1c050d94740196ff6f5a079e89a90e9901faebe0","tarball":"https://registry.npmjs.org/redux-batched-subscribe/-/redux-batched-subscribe-0.1.2.tgz","integrity":"sha512-jP8cdb7RAnFBde3yc7/fSHxSWU4HVJE/88oibIAw+XWnjwdDfbBhrMm09jrdzFAAQLWmDwcHvIc2egv4SwPY+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGQl6vyOww2DGCWR7bRkPOgisaPUO4XTkdbH97XW40GjAiEAlokC/AeBGmYzmAjJe/lBWUYyL4vGrmIJqbsA5CSLPAs="}]},"maintainers":[{"name":"tappleby","email":"terry.appleby@gmail.com"}]},"0.1.3":{"name":"redux-batched-subscribe","version":"0.1.3","description":"redux store enhancer which allows batching subscribe notifications.","main":"lib/index.js","scripts":{"test":"make test","prepublish":"make clean build"},"keywords":["redux","batched","react","reactjs","performance","store"],"author":{"name":"Terry Appleby","email":"terry.appleby@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/tappleby/redux-batched-subscribe.git"},"bugs":{"url":"https://github.com/tappleby/redux-batched-subscribe/issues"},"homepage":"https://github.com/tappleby/redux-batched-subscribe","devDependencies":{"babel":"^5.8.20","babel-core":"^5.8.20","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.0.0","eslint-config-airbnb":"0.0.7","eslint-plugin-react":"^3.1.0","jsdom":"^5.6.0","mocha":"^2.2.5","sinon":"^1.15.4"},"dependencies":{"invariant":"^2.1.0"},"gitHead":"d54d4698723248f45b6484bdff2bf2de9e5cfe0d","_id":"redux-batched-subscribe@0.1.3","_shasum":"35d24fa639909ce55d4dabb1157810f25bb1d325","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"tappleby","email":"terry.appleby@gmail.com"},"dist":{"shasum":"35d24fa639909ce55d4dabb1157810f25bb1d325","tarball":"https://registry.npmjs.org/redux-batched-subscribe/-/redux-batched-subscribe-0.1.3.tgz","integrity":"sha512-jrFKPOVTUH8vl3JQVlSCKoQsuicZt5pTU4mL9ZAS3ob20teotek3DeIG/c8zUKdsBQ56FEGMgxl3khO3X6g90Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsHQmT7DOrdXy5gg9/73Ex4qjSrpbf3b+RwmG+dgmdxwIgAmL+AG/KiCULN9SvVZXJ5yXy0zI6Ovvd99FF4AU5HkQ="}]},"maintainers":[{"name":"tappleby","email":"terry.appleby@gmail.com"}]},"0.1.4":{"name":"redux-batched-subscribe","version":"0.1.4","description":"redux store enhancer which allows batching subscribe notifications.","main":"lib/index.js","scripts":{"test":"make test","prepublish":"make clean build"},"keywords":["redux","batched","react","reactjs","performance","store"],"author":{"name":"Terry Appleby","email":"terry.appleby@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/tappleby/redux-batched-subscribe.git"},"bugs":{"url":"https://github.com/tappleby/redux-batched-subscribe/issues"},"homepage":"https://github.com/tappleby/redux-batched-subscribe","devDependencies":{"babel":"^5.8.20","babel-core":"^5.8.20","babel-eslint":"^4.0.5","chai":"^3.2.0","eslint":"^1.0.0","eslint-config-airbnb":"0.0.7","eslint-plugin-react":"^3.1.0","jsdom":"^5.6.0","mocha":"^2.2.5","sinon":"^1.15.4"},"gitHead":"0dd36d531bc17dbfcbe46e8739df6a51bb00ec5a","_id":"redux-batched-subscribe@0.1.4","_shasum":"817280dc7b2e811111d8449324cd2d3799adf4fd","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"tappleby","email":"terry.appleby@gmail.com"},"dist":{"shasum":"817280dc7b2e811111d8449324cd2d3799adf4fd","tarball":"https://registry.npmjs.org/redux-batched-subscribe/-/redux-batched-subscribe-0.1.4.tgz","integrity":"sha512-ee9iYZs0o3EoFZpTtcbatGyBJfVVopBmy8w5/h3m8RD8907LFuWNQtOA8JTwj6KHcHG57UUAFIMcu+pXEJa8Zg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFp1UMNWMncz4HmI6A8SgB/tRYTB62YJhyIDlb3jNWffAiEAmSaf70qmWx0UOhKcqhQMGE9LpO6ow6OZMO//wC3N6u4="}]},"maintainers":[{"name":"tappleby","email":"terry.appleby@gmail.com"}]},"0.1.5":{"name":"redux-batched-subscribe","version":"0.1.5","description":"redux store enhancer which allows batching subscribe notifications.","main":"lib/index.js","scripts":{"clean":"rimraf lib","build":"babel src --out-dir lib","lint":"eslint src","test":"mocha --compilers js:babel/register --recursive src/**/*-test.js","prepublish":"npm run clean && npm run lint && npm run test && npm run build"},"keywords":["redux","batched","react","reactjs","performance","store"],"author":{"name":"Terry Appleby","email":"terry.appleby@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/tappleby/redux-batched-subscribe.git"},"bugs":{"url":"https://github.com/tappleby/redux-batched-subscribe/issues"},"homepage":"https://github.com/tappleby/redux-batched-subscribe","devDependencies":{"babel":"^5.8.20","babel-core":"^5.8.20","eslint":"^1.0.0","eslint-config-airbnb":"2.1.1","expect":"^1.13.4","mocha":"^2.2.5","rimraf":"^2.5.0"},"gitHead":"e2c87a3154f8a6e6c22f2a930425a1411d4bd0d9","_id":"redux-batched-subscribe@0.1.5","_shasum":"8d7e8354ac5621c237dfe695f7daaf61671d0b20","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"tappleby","email":"terry.appleby@gmail.com"},"dist":{"shasum":"8d7e8354ac5621c237dfe695f7daaf61671d0b20","tarball":"https://registry.npmjs.org/redux-batched-subscribe/-/redux-batched-subscribe-0.1.5.tgz","integrity":"sha512-b4mMASUcCX++wkIMpvfb4RIlarMbM+X93YZlPZ7V6MaR64D3ZHKFW9wdLKOF7knnGAVRZ5soRSDIHctOJk1H3Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0UVDUwikmG/YNcl2B4fCPkao7uHLr5Cz0i4nFh4+3PgIhANFlDn9rVbVM/JKHs7zhlIh8pboZknYNg+Eu8UNmZ7N+"}]},"maintainers":[{"name":"tappleby","email":"terry.appleby@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/redux-batched-subscribe-0.1.5.tgz_1463273764326_0.661152726970613"}},"0.1.6":{"name":"redux-batched-subscribe","version":"0.1.6","description":"redux store enhancer which allows batching subscribe notifications.","main":"lib/index.js","files":["lib","README.md"],"scripts":{"clean":"rimraf lib","build":"babel src --out-dir lib","lint":"eslint src","test":"mocha --compilers js:babel/register --recursive src/**/*-test.js","prepublish":"npm run clean && npm run lint && npm run test && npm run build"},"keywords":["redux","batched","react","reactjs","performance","store"],"author":{"name":"Terry Appleby","email":"terry.appleby@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/tappleby/redux-batched-subscribe.git"},"bugs":{"url":"https://github.com/tappleby/redux-batched-subscribe/issues"},"homepage":"https://github.com/tappleby/redux-batched-subscribe","devDependencies":{"babel":"^5.8.20","babel-core":"^5.8.20","eslint":"^1.0.0","eslint-config-airbnb":"2.1.1","expect":"^1.13.4","mocha":"^2.2.5","rimraf":"^2.5.0"},"gitHead":"05ae65588f360c0598ff7b94a0eda50cb9691fdd","_id":"redux-batched-subscribe@0.1.6","_shasum":"de928602708df7198b4d0c98c7119df993780d59","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"tappleby","email":"terry.appleby@gmail.com"},"dist":{"shasum":"de928602708df7198b4d0c98c7119df993780d59","tarball":"https://registry.npmjs.org/redux-batched-subscribe/-/redux-batched-subscribe-0.1.6.tgz","integrity":"sha512-rJAKFDZMen/ZKmVJOC3/qWVil/0yV7v2vWXZdgTA7Fg4mt3KkHPonRV5rGDUaElP2RfViLc2ezzDTNKCppOHLg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbElaXbvARDMzP+0pZgR4Qv59iyXga5HWg0gM+PMce0gIgI+WOyGKoIAbcHuOYCSQrV+XGomLAzwO60Ho6czFDklc="}]},"maintainers":[{"name":"tappleby","email":"terry.appleby@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/redux-batched-subscribe-0.1.6.tgz_1465056231271_0.32626786013133824"}}},"readme":"redux-batched-subscribe\n=====================\n\n[![build status](https://img.shields.io/travis/tappleby/redux-batched-subscribe/master.svg?style=flat-square)](https://travis-ci.org/tappleby/redux-batched-subscribe)\n[![npm version](https://img.shields.io/npm/v/redux-batched-subscribe.svg?style=flat-square)](https://www.npmjs.com/package/redux-batched-subscribe)\n\nStore enhancer for [redux](https://github.com/rackt/redux) which allows batching of subscribe notifications that occur as a result of dispatches.\n\n```js\nnpm install --save redux-batched-subscribe\n```\n\n## Usage\n\nThe `batchedSubscribe` store enhancer accepts a function which is called after every dispatch with a `notify` callback as a single argument. Calling the `notify` callback will trigger all the subscription handlers, this gives you the ability to use various techniques to delay subscription notifications such as: debouncing, React batched updates or requestAnimationFrame.\n\nSince `batchedSubscribe` overloads the dispatch and subscribe handlers on the original redux store it is important that it gets applied before any other store enhancers or middleware that depend on these functions; The [compose](https://github.com/rackt/redux/blob/master/docs/api/compose.md) utility in redux can be used to handle this:\n\n```js\nimport { createStore, applyMiddleware, compose } from 'redux';\nimport { batchedSubscribe } from 'redux-batched-subscribe';\n\nconst enhancer = compose(\n  applyMiddleware(...middleware),\n  batchedSubscribe((notify) => {\n    notify();\n  })\n)\n\n// Note: passing enhancer as the last argument to createStore requires redux@>=3.1.0\nconst store = createStore(reducer, initialState, enhancer);\n```\n\n*Note: since `compose` applies functions from right to left, `batchedSubscribe` should appear at the end of the chain.*\n\nThe store enhancer also exposes a `subscribeImmediate` method which allows for unbatched subscribe notifications.\n\n## Examples\n\n### Debounced subscribe handlers:\n\n```js\nimport { createStore } from 'redux';\nimport { batchedSubscribe } from 'redux-batched-subscribe';\nimport debounce from 'lodash.debounce';\n\nconst batchDebounce = debounce(notify => notify());\nconst finalCreateStore = batchedSubscribe(batchDebounce)(createStore);\nconst store = finalCreateStore(reducer, intialState);\n```\n\n### React batched updates\n\n```js\nimport { createStore } from 'redux';\nimport { batchedSubscribe } from 'redux-batched-subscribe';\n\n// React <= 0.13\nimport { addons } from 'react/addons';\nconst batchedUpdates = addons.batchedUpdates;\n\n// React 0.14\nimport { unstable_batchedUpdates as batchedUpdates } from 'react-dom';\n\n// Note: passing batchedSubscribe as the last argument to createStore requires redux@>=3.1.0\nconst store = createStore(reducer, intialState, batchedSubscribe(batchedUpdates));\n```\n\n## Thanks\n\nThanks to [Andrew Clark](https://github.com/acdlite) for the clean library structure.\n","maintainers":[{"name":"tappleby","email":"terry.appleby@gmail.com"}],"time":{"modified":"2022-06-26T10:00:29.937Z","created":"2015-08-03T15:52:31.857Z","0.1.0":"2015-08-03T15:52:31.857Z","0.1.1":"2015-08-03T15:56:27.341Z","0.1.2":"2015-08-03T16:36:20.538Z","0.1.3":"2015-08-15T00:19:03.570Z","0.1.4":"2015-08-15T16:58:26.989Z","0.1.5":"2016-05-15T00:56:06.660Z","0.1.6":"2016-06-04T16:03:53.749Z"},"homepage":"https://github.com/tappleby/redux-batched-subscribe","keywords":["redux","batched","react","reactjs","performance","store"],"author":{"name":"Terry Appleby","email":"terry.appleby@gmail.com"},"bugs":{"url":"https://github.com/tappleby/redux-batched-subscribe/issues"},"license":"MIT","readmeFilename":"README.md","repository":{"type":"git","url":"git+https://github.com/tappleby/redux-batched-subscribe.git"},"users":{"ohcoder":true,"nisimjoseph":true}}