The lolo/buffer library function helps you batch events and lets you control when to send them.
The lolo/buffer library function is used as a middleware between an event trigger and then the next function. A good use case is streaming data of some kind that needs to be batched and processes in another function. You would attach the lolo/buffer library function in between these nodes.
The library function batches the events until a specific buffer size has been reached so you can control how many events to send to the next function. You specify the max buffer size and an optional timeout under Parameters inside the function.
See a full video tutorial on how to buffer 5 events coming from the Timer Trigger every second and then log the batched event data to the console in another function.
Updated 5 months ago