bufferedCount<T> static method

BufferedCountBeacon<T> bufferedCount<T>(
  1. int count
)

Creates a BufferedCountBeacon that collects and buffers a specified number of values. Once the count threshold is reached, the beacon's value is updated with the list of collected values and the buffer is reset.

This beacon is useful in scenarios where you need to aggregate a certain number of values before processing them together.

Example:

var countBeacon = BufferedCountBeacon<int>(countThreshold: 3);
countBeacon.subscribe((values) {
  print(values); // Outputs the list of collected values
});
countBeacon.value = 1;
countBeacon.value = 2;
countBeacon.value = 3; // Triggers update with [1, 2, 3]

Implementation

static BufferedCountBeacon<T> bufferedCount<T>(int count) =>
    BufferedCountBeacon<T>(countThreshold: count);