x51
Utility for aggregating and flushing items to be processed
When do I use this?
Use this when you want to collect items, and flush them out to another function when either you have enough items, or when enough time has passed.
How do I use it?
// require('x51') returns a function to initialize a new x51 instancevar x51 = flushInterval: 60000 // Milliseconds between flushing, defaults to 60,000 maxRecords: Infinity // Max items to collect before flushing, defaults to Infinity { // Receives a non-empty array of items to be flushed. // If this function throws an error, or returns a promise that is rejected, // then these items are automatically kept, and will be flushed again next time. console; }; x51;x51; // If you feel the need, you can also manually flush at any time...x51;