- Require Dart 3.1 or greater
- Forward errors from the
trigger
future through to the result stream intakeUntil
. Previously an error would have not closed the stream, and instead raised as an unhandled async error. - Move to
dart-lang/tools
monorepo.
- Add
whereNotNull
.
- Require Dart 2.14 or greater.
- Wait for the future returned from
StreamSubscription.cancel()
before listening to the subsequent stream inswitchLatest
andswitchMap
.
- Migrate to null safety.
- Improve tests of
switchMap
and improve documentation with links and clarification. - Add
trailing
argument tothrottle
.
- Add support for emitting the "leading" event in
debounce
.
- Fix a bug in
asyncMapSample
,buffer
,combineLatest
,combineLatestAll
,merge
, andmergeAll
which would cause an exception when cancelling a subscription after using the transformer if the original stream(s) returnednull
from cancelling their subscriptions.
- Add
concurrentAsyncExpand
to interleave events emitted by multiple sub streams created by a callback.
- Remove the top level methods and retain the extensions only.
-
Add extension methods for most transformers. These should be used in place of the current methods. All current implementations are deprecated and will be removed in the next major version bump.
- Migrating typical use: Instead of
stream.transform(debounce(Duration(seconds: 1)))
usestream.debounce(Duration(seconds: 1))
. - To migrate a usage where a
StreamTransformer
instance is stored or passed see "Getting a StreamTransformer instance" on the README.
- Migrating typical use: Instead of
-
The
map
andchainTransformers
utilities are no longer useful with the new patterns so they are deprecated without a replacement. If you still have a need for them they can be replicated withStreamTransformer.fromBind
:// Replace `map(convert)` StreamTransformer.fromBind((s) => s.map(convert)); // Replace `chainTransformers(first, second)` StreamTransformer.fromBind((s) => s.transform(first).transform(second));
- Add
asyncMapSample
transform.
- Internal cleanup. Passed "trigger" streams or futures now allow
<void>
generic type rather than an implicitdynamic>
- Add concrete types to the
onError
callback intap
.
- Remove usage of Set literal which is not available before Dart 2.2.0
- Allow a
combine
callback to return aFutureOr<T>
inscan
. There are no behavior changes for synchronous callbacks. Potential breaking change In the unlikely situation wherescan
was used to produce aStream<Future>
inference may now fail and require explicit generic type arguments. - Add
combineLatest
. - Add
combineLatestAll
.
- Add
whereType
.
- Allow using non-dev Dart 2 SDK.
asyncWhere
will now forward exceptions thrown by the callback through the result Stream.- Added
concurrentAsyncMap
.
mergeAll
now accepts anIterable<Stream>
instead of onlyList<Stream>
.
- Add
chainTransformers
andmap
for use cases whereStreamTransformer
instances are stored as variables or passed to methods other thantransform
.
- Renamed
concat
asfollowedBy
to match the naming ofIterable.followedBy
.concat
is now deprecated.
- Updates to support Dart 2.0 core library changes (wave 2.2). See issue 31847 for details.
- Add
asyncMapBuffer
.
- Add
takeUntil
.
- Bug Fix: Streams produced with
scan
andswitchMap
now correctly reportisBroadcast
. - Add
startWith
,startWithMany
, andstartWithStream
.
- Bug Fix: Some transformers did not correctly add data to all listeners on
broadcast streams. Fixed for
throttle
,debounce
,asyncWhere
andaudit
. - Bug Fix: Only call the
tap
data callback once per event rather than once per listener. - Bug Fix: Allow canceling and re-listening to broadcast streams after a
merge
transform. - Bug Fix: Broadcast streams which are buffered using a single-subscription trigger can be canceled and re-listened.
- Bug Fix: Buffer outputs one more value if there is a pending trigger before the trigger closes.
- Bug Fix: Single-subscription streams concatted after broadcast streams are handled correctly.
- Use sync
StreamControllers
for forwarding where possible.
- Bug Fix: Allow compiling switchLatest with Dart2Js.
- Add
asyncWhere
: Likewhere
but allows an asynchronous predicate.
- Add
scan
: fold which returns intermediate values - Add
throttle
: block events for a duration after emitting a value - Add
audit
: emits the last event received after a duration
- Add
tap
: React to values as they pass without being a subscriber on a stream - Add
switchMap
andswitchLatest
: Flatten a Stream of Streams into a Stream which forwards values from the most recent Stream
- Add
concat
: Appends streams in series - Add
merge
andmergeAll
: Interleaves streams
- Initial release with the following utilities:
buffer
: Collects events in aList
until atrigger
stream fires.debounce
,debounceBuffer
: Collect or drop events which occur closer in time than a given duration.