Update Batcher
Update Batcher batches all the calls to an update function to reduce calls to the database.
How to use
Install the library
npm install --save update-batcher
or
yarn add update-batcher
Import the module
const UpdateBatcher = ;
Create an instance passing an update function and optionally a batching function
const database = a: 1 ; const updater = { databasea = x;}; // or with a custom batching functionconst multiplicativeUpdater = { databasea = x;} a * b;
Run updates
// the update function will be called only onceupdaterupdaterupdater