NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #151 most downloaded on pub.dev
RxDart is an implementation of the popular ReactiveX api for asynchronous programming, leveraging the native Dart Streams api.
Last release 2 years ago
no release in 18 months
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 57 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
132 releases · first in 2015
Replace deprecated "dart pub run" with "dart run" (thanks to @tatsuyafujisaki ).
ValueStream:
lastEventOrNull getter to ValueStream,null.isLastEventValue, isLastEventError and errorAndStackTraceOrNullValueStream, to check the kind of the last emitted event is data/value or error.ReplayStream:
errorAndStackTraces to ReplayStream, which returns a list of emitted ErrorAndStackTraces.Rename Notification and Kind to better reflect their purpose,
and to avoid confusion with Flutter's Notification class.
Notification to StreamNotification
Notification.onData to StreamNotification.data.Notification.onDone to StreamNotification.done.Notification.onError to StreamNotification.error.Kind to NotificationKind
Kind.onData to NotificationKind.data.Kind.onError to NotificationKind.error.Kind.onDone to NotificationKind.done.DataNotification, ErrorNotification and DoneNotification as the subclasses of StreamNotification.isOnData, isOnError, isOnDone, requireData to extension getters on StreamNotification,isData, isError, isDone and requireDataValue.StreamNotification: dataValueOrNull, requireErrorAndStackTrace, errorAndStackTraceOrNull getters and when method.Accept Dart SDK versions above 3.0.
switchMap: when cancelling the previous inner subscription,
switchMap will pause the outer subscription and and wait for the inner subscription to be completely canceled.
It will then resume the outer subscription, and listen to the next inner Stream.
Any errors from canceling the previous inner subscription will now be forwarded to the resulting Stream.
Breaking: Rename ForkJoinStream.combine2..combine9 to ForkJoinStream.join2..join9.
Breaking: Rx.using/UsingStream
disposer is now called after the future returned from StreamSubscription.cancel completes.One column per quarter.
Feedback on this change appreciated as this is a dev release before 0.28.0 stable!
Feedback on this change appreciated as this is a dev release before 0.28.0 stable!
ForkJoinStream.combine2..combine9 to ForkJoinStream.join2..join9.Rx.using/UsingStream
disposer is now called after the future returned from StreamSubscription.cancel completes.Replace deprecated "dart pub run" with "dart run" (thanks to @tatsuyafujisaki ).
Feedback on this change appreciated as this is a dev release before 0.28.0 stable!
switchMap: when cancelling the previous inner subscription,switchMap will pause the outer subscription and and wait for the inner subscription to be completely canceled.Full Changelog: 0.28.0-dev.0...0.28.0-dev.1
https://pub.dev/packages/rxdart/versions/0.28.0-dev.0
Feedback on this change appreciated as this is a dev release before 0.28.0 stable!
ValueStream:
lastEventOrNull getter to ValueStream,null.isLastEventValue, isLastEventError and errorAndStackTraceOrNullValueStream, to check the kind of the last emitted event is data/value or error.ReplayStream:
errorAndStackTraces to ReplayStream, which returns a list of emitted ErrorAndStackTraces.Rename Notification and Kind to better reflect their purpose,
and to avoid confusion with Flutter's Notification class.
Notification to StreamNotification
Notification.onData to StreamNotification.data.Notification.onDone to StreamNotification.done.Notification.onError to StreamNotification.error.Kind to NotificationKind
Kind.onData to NotificationKind.data.Kind.onError to NotificationKind.error.Kind.onDone to NotificationKind.done.DataNotification, ErrorNotification and DoneNotification as the subclasses of StreamNotification.isOnData, isOnError, isOnDone, requireData to extension getters on StreamNotification,isData, isError, isDone and requireDataValue.StreamNotification: dataValueOrNull, requireErrorAndStackTrace, errorAndStackTraceOrNull getters and when method.Notification.toString(), add tests for Notifications by @hoc081098 in #703Full Changelog: 0.27.7...0.28.0-dev.0
https://pub.dev/packages/rxdart/versions/0.27.7
Subject
Only call onAdd and onError if the subject is not closed.
This ensures BehaviorSubject and ReplaySubject do not update their values after they have been closed.
Subject.stream now returns a read-only Stream.
Previously, Subject.stream was identical to the Subject, so we could add events to it, for example: (subject.stream as Sink<T>).add(event).
This behavior is now disallowed, and will throw a TypeError if attempted. Use Subject.sink/Subject itself for adding events.
Change return type of ReplaySubject<T>.stream to ReplayStream<T>.
Internal refactoring of Subject.addStream.
onAdd and onError if the subject is not closed by @hoc081098 in #698Subject.stream now returns a read-only Stream by @hoc081098 in #699Full Changelog: 0.27.6...0.27.7
https://pub.dev/packages/rxdart/versions/0.27.6
Rx.using/UsingStream: resourceFactory can now return a Future.
This allows for asynchronous resource creation.
Rx.range/RangeStream: ensure RangeStream is only listened to once.
RangeStream can only be listened to once by @hoc081098 in #690resourceFactory can return a Future by @hoc081098 in #696Full Changelog: 0.27.5...0.27.6
https://pub.dev/packages/rxdart/versions/0.27.5
Fix issue #683: Throws runtime type error when using extension
methods on a Stream<R> but its type annotation is Stream<T>, R is a subtype of T
(covariance issue with StreamTransformer).
Stream<num> s1 = Stream<int>.fromIterable([1, 2, 3]);
// throws "type 'SwitchMapStreamTransformer<num, num>' is not a subtype of type 'StreamTransformer<int, num>' of 'streamTransformer'"
s1.switchMap((v) => Stream.value(v));
Stream<int?> s2 = Stream<int>.fromIterable([1, 2, 3]);
// throws "type 'SwitchMapStreamTransformer<int?, int?>' is not a subtype of type 'StreamTransformer<int, int?>' of 'streamTransformer'"
s2.switchMap((v) => Stream.value(v));Extension methods were previously implemented via stream.transform(streamTransformer), now
via streamTransformer.bind(stream) to avoid this issue.
Fix concatEager: activeSubscription should be changed to next subscription.
pairwise to Stream<List<T>>.Full Changelog: 0.27.4...0.27.5
Fix issue #683: Throws runtime type error when using extension
methods on a Stream<R> but its type annotation is Stream<T>, R is a subtype of T
(covariance issue with StreamTransformer).
Stream<num> s1 = Stream<int>.fromIterable([1, 2, 3]);
// throws "type 'SwitchMapStreamTransformer<num, num>' is not a subtype of type 'StreamTransformer<int, num>' of 'streamTransformer'"
s1.switchMap((v) => Stream.value(v));
Stream<int?> s2 = Stream<int>.fromIterable([1, 2, 3]);
// throws "type 'SwitchMapStreamTransformer<int?, int?>' is not a subtype of type 'StreamTransformer<int, int?>' of 'streamTransformer'"
s2.switchMap((v) => Stream.value(v));
Extension methods were previously implemented via stream.transform(streamTransformer), now
via streamTransformer.bind(stream) to avoid this issue.
Fix concatEager: activeSubscription should be changed to next subscription.
pairwise to Stream<List<T>>.ci: remove deprecated packages flag by @beeth0ven in #674
withLatestFrom should iterate over Iterable<Stream>s only once when the stream is listened to.Dart 2.16.0.mapNotNull/MapNotNullStreamTransformer.whereNotNull/WhereNotNullStreamTransformer.RaceStream (thanks to @Péter Ferenc Gyarmati).Iterable<Stream> once by @hoc081098 in #662rxmarbles URL for RaceStream by @peter-gy in #669pub: command not found by @beeth0ven in #673packages flag by @beeth0ven in #674Full Changelog: 0.27.3...0.27.4
https://pub.dev/packages/rxdart/versions/0.27.3
flatMap now creates inner Streams lazily.combineLatest, concat, concatEager, forkJoin, merge, race, zip iterate over Iterable<Stream>s only onceautoConnect, connect and refCount together, only one of them should be used.AbstractConnectableStream, base class for the ConnectableStream implementations.CompositeSubscription (thanks to @BreX900)
dispose, clear, and remove methods now return a completion future.StreamSubscription.CompositeSubscription.add will throw a StateError instead of a String if this composite was disposed.Connectable examples.Flutter example: SearchResultItem.fromJson type error (thanks to @WenYeh)takeLast implementation.pedantic to lints and flutter_lints.BehaviorSubject, ReplaySubject implementations by using "Sentinel object"s instead of ValueWrappers.Full Changelog: 0.27.2...0.27.3
Remove @deprecated annotation (ignoreElements should not be marked as deprecated).
onErrorReturnWith now does not drop the remaining data events after the first error.ConnectableStreamSubscription.delayWhen operator.maxConcurrent to flatMap.groupBy
GroupByStream to GroupedStream.durationSelector, which used to determine how long each group should exist.ignoreElements
@deprecated annotation (ignoreElements should not be marked as deprecated).Stream<Never>.PublishSubject's docs (thanks to @AlexanderJohr).Stream.multi internally.Bugfix: ForkJoinStream throws Null check operator used on a null value when using nullable-type.
ForkJoinStream throws Null check operator used on a null value when using nullable-type.delay operator
ValueStream.valueWrapper becomes
ValueStreamExtensions.ValueStream.valueWrapper becomes
value.valueOrNull.hasValue.ValueStream.errorAndStackTrace becomes
error.errorOrNull.hasError.stackTrace.skipLast/SkipLastStreamTransformer (thanks @HannibalKcc).scan: change seed to required param.StackTrace param to recoveryFn when using OnErrorResumeStreamTransformer/onErrorResume/onErrorReturnWith.ConnectableStream.Add takeLast (thanks @ThomasKliszowski).
takeLast (thanks @ThomasKliszowski).retry/retryWhen:
RetryError.retry: emits all errors if retry fails.retryWhen: emits original error, and error from factory if they are not identical.streamFactory now accepts non-nullable StackTrace argument.ValueStream.requireValue and ValueStream.requireError: throws actual error or a StateError,
instead of throwing "Null check operator used on a null value" error.Add valueWrapper to ValueStream.
ValueStream
valueWrapper to ValueStream.value, hasValue, error and hasError to extension getters.throttle/throttleTime have been optimised for performance.Migrate this package to null safety.
>=2.12.0-0 <3.0.0 based on beta release guidelines.Sync behavior when using publishValueSeeded.
publishValueSeeded.
ValueStream, ReplayStream: exposes stackTrace along with the error:
ValueStream.error to ValueStream.errorAndStackTrace.ReplayStream.errors to ReplayStream.errorAndStackTraces.Notification.error and Notification.stackTrace into Notification.errorAndStackTrace.debounce/debounceTime unnecessarily kept too many elements in queue.Bugfix: switchMap doesn't close after the last inner Stream closes.
switchMap doesn't close after the last inner Stream closes.
FromCallableStream/Rx.fromCallable: allows you to create a Stream from a callable function.BehaviorSubject's built-in operators to correct replaying the latest value of BehaviorSubject.StreamSubscription doesn't cancel when cancelling refCount, zip, merge, concat StreamSubscription.ConnectableStream.Internal refactoring Stream Transformers.
RetryStream example documentation.DeferStream factory will now be caught and converted to Stream.error.doOnError now have strong type signature: Stream<T> doOnError(void Function(Object, StackTrace) onError).ForkJoinStream:
cancelOnError: true on the downstream.UsingStream.TimerStream: Pause and resume Timer when pausing and resuming StreamSubscription.stream transformations on a ValueStream will also return a ValueStream, instead of a standard broadcast Stream
Fix for BehaviorSubject, no longer emits null when using addStream and expecting an Error as first event (thanks yuvalr1)
Fix throttle no longer outputting the current buffer onDone
Breaking: as of this release, we've refactored the way Stream transformers are set up. Previous releases had some incorrect behavior when using certai
Breaking: as of this release, we've refactored the way Stream transformers are set up. Previous releases had some incorrect behavior when using certain operators, for example:
startWith (startWithMany, startWithError) would incorrectly replay the starting event(s) when using a broadcast Stream at subscription time.
doOnX was not always producing the expected results:
To properly fix this up, a new way of transforming Streams was introduced.
Operators as of now use Stream.eventTransformed and we've refactored all
operators to implement Sink instead.
We encourage everyone to give the dev release(s) a spin and report back if anything breaks. If needed, a guide will be written to help migrate from the old behavior to the new behavior in certain common use cases.
Keep in mind that we tend to stick as close as we can to how normal Dart Streams work!
* Fix API doc links in README
Removed deprecated ofType method, use whereType instead
Observable class!
Rx class.Observable.just, use Stream.valueObservable.error, use Stream.errorValueObservable -> ValueStreamReplayObservable -> ReplayStreamConnectableObservable -> ConnectableStreamValueConnectableObservable -> ValueConnectableStreamReplayConnectableObservable -> ReplayConnectableStreamofType method, use whereType insteadconcatMap, use standard Stream asyncExpand.AsObservableFuture, MinFuture, MaxFuture, and WrappedFuture
asObservable method in chainsasStream method from the base Future class instead.min and max now implemented directly on the Stream class* Fix missing exports: - ValueStream - ReplayStream - ConnectableStream - ValueConnectableStream - ReplayConnectableStream
ValueStreamReplayStreamConnectableStreamValueConnectableStreamReplayConnectableStreamRemove the Observable class. With extensions, you no longer need to wrap Streams in a [Stream]!
Rx class.Observable.just, use Stream.valueObservable.error, use Stream.errorValueObservable -> ValueStreamReplayObservable -> ReplayStreamConnectableObservable -> ConnectableStreamValueConnectableObservable -> ValueConnectableStreamReplayConnectableObservable -> ReplayConnectableStreamRemoved deprecated ofType method, use whereType instead
ofType method, use whereType insteadconcatMap, use standard Stream asyncExpand.AsObservableFuture, MinFuture, MaxFuture, and WrappedFuture
asObservable method in chainsasStream method from the base Future class instead.min and max now implemented directly on the Stream classBugfix: When listening multiple times to aBehaviorSubject that starts with an Error, it emits duplicate events.
BehaviorSubject that starts with an Error,
it emits duplicate events.
Bugfix: DeferStream created Stream too early
Bugfix: switchMap controller no longer closes prematurely
Bugfix: whereType failing in Flutter production builds only
Deprecates ofType in favor of whereType, drop TypeToken.
BehaviorSubject and adding an Error,
upon listening, the BehaviorSubject emits null instead of the last Error.
switchMap can cause a NoSuchMethodError.Observable.withLatestFrom is now expanded to accept 2 or more Streams
thanks to Petrus Nguyễn Thái Học (@hoc081098)!ofType in favor of whereType, drop TypeToken.Erroneous behavior with scan and BehaviorSubject.
Fixes following issues:
BehaviorSubject.flatMap would cancel inner subscriptions in pause/resume.Nothing published for this version
Breaking Change: debounce is now split into debounce and debounceTime.
This version includes refactoring for the backpressure operators:
debounce is now split into debounce and debounceTime.sample is now split into sample and sampleTime.throttle is now split into throttle and throttleTime.Breaking Change: BehaviorSubject now has a separate factory constructor seeded() This allows you to seed this Subject with a null value.
BehaviorSubject now has a separate factory constructor seeded()
This allows you to seed this Subject with a null value.
BehaviorSubject will now emit an Error, if the last event was also an Error.
Before, when an Error occurred before a listen, the subscriber would not be notified of that Error.
To refactor, simply change all occurences of BehaviorSubject(seedValue: value) to BehaviorSubject.seeded(value)groupBy operatordoOnCancel: will now await the cancel result, if it is a Future.bufferWithCount, windowWithCount, tween
Please use bufferCount and windowCount, tween is removed, because it never was an official Rx spec.Breaking Change: bufferCount had buggy behavior when using startBufferEvery (was skip previously) If you were relying on bufferCount with skip greater…
startBufferEvery (was skip previously)
If you were relying on bufferCount with skip greater than 1 before, then you may have noticed
erroneous behavior.
repeat is no longer an operator which simply repeats the last emitted event n-times,
instead this is now an Observable factory method which takes a StreamFactory and a count parameter.
This will cause each repeat cycle to create a fresh Observable sequence.mapTo is a new operator, which works just like map, but instead of taking a mapper Function, it takes
a single value where each event is mapped to.bufferWithCount, windowWithCount, amb, flatMapLatestBreaking Change: Subjects onCancel function now returns void instead of Future to properly comply with the StreamController signature.
onCancel function now returns void instead of Future to properly comply with the StreamController signature.
connect method is calledpublishValue or shareValuepublishReplay or shareReplayAdd retryWhen operator. Thanks to Razvan Lung (@long1eu)! This can be used for custom retry logic.
retryWhen operator. Thanks to Razvan Lung (@long1eu)! This can be used for custom retry logic.Breaking Change: remove retype method, deprecated as part of Dart 2.
retype method, deprecated as part of Dart 2.flatMapIterableBreaking Change: stream property on Observable is now private.
stream property on Observable is now private.
stream property to use a super constructor insteadamb/race, combineLatest, concat, concat_eager, merge and zipswitchLatest operatoronErrorResume and onErrorRetryWith operators. These allow folks to return a specific stream or value depending on the error that occurred.Fix new buffer and window implementation for Flutter + Dart 2
Rework for buffer and window, allow to schedule using a sampler
buffer and window, allow to schedule using a samplerbufferbufferFuturebufferTestbufferTimebufferWhenwindowwindowFuturewindowTestwindowTimewindowWhenonCount sampler for buffer and windowonFuture sampler for buffer and windowonTest sampler for buffer and windowonTime sampler for buffer and windowonStream sampler for buffer and windowRenames flatMapLatest to switchMap
amb to raceflatMapLatest to switchMapbufferWithCount to bufferCountwindowWithCount to windowCount* Adds bufferTime transformer. * Adds windowTime transformer.
bufferTime transformer.windowTime transformer.* Adds delay transformer.
delay transformer.Fix added events to sink are not processed correctly by Subjects.
sink are not processed correctly by Subjects.Fix dematerialize method for Dart 2.
dematerialize method for Dart 2.breaks backwards compatibility, this release only works with Dart SDK >=2.0.0.
cast in favour of the now native Stream cast method.retype to return an Observable.* Update Changelog
Add value to BehaviorSubject. Allows you to get the latest value emitted by the subject if it exists.
value to BehaviorSubject. Allows you to get the latest value emitted by the subject if it exists.values to ReplayrSubject. Allows you to get the values stored by the subject if any exists.Add exhaustMap map to inner observable, ignore other values until that observable completes.
exhaustMap map to inner observable, ignore other values until that observable completes.Change debounce to emit the last item of the source stream as soon as the source stream completes.
debounce to emit the last item of the source stream as soon as the source stream completes.debounce does not keep open any addition async timers after it has been cancelled.Add PublishSubject (thanks to @pauldemarco)
PublishSubject (thanks to @pauldemarco)doOnX operators where callbacks were fired too oftenChange DoStreamTransformer to return a Future on cancel for api compatibility.
DoStreamTransformer to return a Future on cancel for api compatibility.Nothing published for this version
Fix error with FlatMapLatest where it was not properly cancelled in some scenarios
Remove call operator / StreamTransformer entirely
call operator / StreamTransformer entirelyStreamSubscription.Deprecated call and CallStreamTransformer. Please use the appropriate doOnX operator / transformer.
call.DoStreamTransformer as a replacement for CallStreamTransformercall and CallStreamTransformer. Please use the appropriate doOnX operator / transformer.distinctUnique. Emits items if they've never been emitted before. Same as to Rx#distinct.Observable.groupBy has been removed in order to be compatible with the next version of the Stream class in Dart 1.24.0, which includes this method
Stream class in Dart 1.24.0, which includes this methodYour coding agent can read these notes before it upgrades. Set up the MCP server →