You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
throttleTime repeats the event if there was only one in the window #817
/// Emits a value from the source [Stream], then ignores subsequent source values
/// for a duration, then repeats this process.
///
/// If leading is true, then the first item in each window is emitted.
/// If [trailing] is true, then the last item is emitted instead.
///
/// ### Example
///
/// Stream.fromIterable([1, 2, 3])
/// .throttleTime(Duration(seconds: 1));
Stream<T> throttleTime(Duration duration,
But I don't see a reason for the documented behavior. By allowing both leading and trailing to be true, the interface is misleading. If trailing was meant to suppress the leading, it had to be an enum with leading and trailing as values.
leading must take priority and emit the first event right away. And then trailing should emit the last event only if something else came after that.
If this is not what this transformer is supposed to do, we need another one that actually does that because it's a common need.
Activity