Releases: ReactiveX/rxdart
0.28.0
New
-
ValueStream:
- Add
lastEventOrNull
getter toValueStream
,
which returns the last emitted event (either data/value or error event), ornull
. - Add
isLastEventValue
,isLastEventError
anderrorAndStackTraceOrNull
extension getters toValueStream
, to check the kind of the last emitted event is data/value or error. - Update documentation.
- Add
-
ReplayStream:
- Add
errorAndStackTraces
toReplayStream
, which returns a list of emittedErrorAndStackTrace
s.
- Add
-
Rename
Notification
andKind
to better reflect their purpose,
and to avoid confusion with Flutter's Notification class.- Rename
Notification
toStreamNotification
Notification.onData
toStreamNotification.data
.Notification.onDone
toStreamNotification.done
.Notification.onError
toStreamNotification.error
.
- Rename
Kind
toNotificationKind
Kind.onData
toNotificationKind.data
.Kind.onError
toNotificationKind.error
.Kind.onDone
toNotificationKind.done
.
- Introduce
DataNotification
,ErrorNotification
andDoneNotification
as the subclasses ofStreamNotification
. - Convert
isOnData
,isOnError
,isOnDone
,requireData
to extension getters onStreamNotification
,
they are now namedisData
,isError
,isDone
andrequireDataValue
. - Add extensions on
StreamNotification
:dataValueOrNull
,requireErrorAndStackTrace
,errorAndStackTraceOrNull
getters andwhen
method.
- Rename
Changed
-
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
toForkJoinStream.join2
..join9
. -
Breaking:
Rx.using
/UsingStream
- Convert all required positional parameters to required named parameters.
- The
disposer
is now called after the future returned fromStreamSubscription.cancel
completes.
Documentation
- Update and fix documentation.
- Fix README example (thanks to @wurikiji).
- Update Flutter example (thanks to @hoangchungk53qx1).
- Replace deprecated "dart pub run" with "dart run" (thanks to @tatsuyafujisaki).
0.28.0-dev.2
Feedback on this change appreciated as this is a dev release before 0.28.0 stable!
Changed
- Breaking: Rename
ForkJoinStream.combine2
..combine9
toForkJoinStream.join2
..join9
. - Breaking:
Rx.using
/UsingStream
- Convert all required positional parameters to required named parameters.
- The
disposer
is now called after the future returned fromStreamSubscription.cancel
completes.
0.28.0-dev.1
https://pub.dev/packages/rxdart/versions/0.28.0-dev.1
Feedback on this change appreciated as this is a dev release before 0.28.0 stable!
Changed
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.
Documentation
- Replace deprecated "dart pub run" with "dart run" (thanks to @tatsuyafujisaki).
What's Changed
- Replace deprecated "dart pub run" with "dart run" by @tatsuyafujisaki in #739
- switchMap: pause the outer subscription when cancelling the inner subscription, then resuming by @hoc081098 in #737
- Fix LICENSE by @hoc081098 in #741
- Update README.md [skip ci] by @hoc081098 in #742
- chore(publish): prepare for v0.28.0-dev.1 by @hoc081098 in #745
New Contributors
- @tatsuyafujisaki made their first contribution in #739
Full Changelog: 0.28.0-dev.0...0.28.0-dev.1
0.28.0-dev.0
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!
New
-
ValueStream:
- Add
lastEventOrNull
getter toValueStream
,
which returns the last emitted event (either data/value or error event), ornull
. - Add
isLastEventValue
,isLastEventError
anderrorAndStackTraceOrNull
extension getters toValueStream
, to check the kind of the last emitted event is data/value or error. - Update documentation.
- Add
-
ReplayStream:
- Add
errorAndStackTraces
toReplayStream
, which returns a list of emittedErrorAndStackTrace
s.
- Add
-
Rename
Notification
andKind
to better reflect their purpose,
and to avoid confusion with Flutter's Notification class.- Rename
Notification
toStreamNotification
Notification.onData
toStreamNotification.data
.Notification.onDone
toStreamNotification.done
.Notification.onError
toStreamNotification.error
.
- Rename
Kind
toNotificationKind
Kind.onData
toNotificationKind.data
.Kind.onError
toNotificationKind.error
.Kind.onDone
toNotificationKind.done
.
- Introduce
DataNotification
,ErrorNotification
andDoneNotification
as the subclasses ofStreamNotification
. - Convert
isOnData
,isOnError
,isOnDone
,requireData
to extension getters onStreamNotification
,
they are now namedisData
,isError
,isDone
andrequireDataValue
. - Add extensions on
StreamNotification
:dataValueOrNull
,requireErrorAndStackTrace
,errorAndStackTraceOrNull
getters andwhen
method.
- Rename
Changed
- Accept Dart SDK versions above 3.0.
Documentation
- Update and fix documentation.
- Fix README example (thanks to @wurikiji).
- Update Flutter example (thanks to @hoangchungk53qx1).
What's Changed
- docs(using): fix typo by @hoc081098 in #704
- improve
Notification.toString()
, add tests for Notifications by @hoc081098 in #703 - fix example on README by @wurikiji in #712
- Create .github/dependabot.yml by @hoc081098 in #714
- update example github_search by @hoangchungk53qx1 in #717
- Fix lints and accept Dart SDK versions above 3.0 by @hoc081098 in #721
- feat(ValueStream): add lastEventOrNull, isLastEventValue, isLastEventError, errorAndStackTraceOrNull by @hoc081098 in #729
- refactor(utils): rename Notification to StreamNotification, Kind to NotificationKind by @hoc081098 in #731
- docs: update docs by @hoc081098 in #733
- chore(publish): prepare for v0.28.0-dev.0 by @hoc081098 in #734
New Contributors
- @wurikiji made their first contribution in #712
- @hoangchungk53qx1 made their first contribution in #717
Full Changelog: 0.27.7...0.28.0-dev.0
0.27.7
https://pub.dev/packages/rxdart/versions/0.27.7
Fixed
Subject
-
Only call
onAdd
andonError
if the subject is not closed.
This ensuresBehaviorSubject
andReplaySubject
do not update their values after they have been closed. -
Subject.stream
now returns a read-onlyStream
.
Previously,Subject.stream
was identical to theSubject
, so we could add events to it, for example:(subject.stream as Sink<T>).add(event)
.
This behavior is now disallowed, and will throw aTypeError
if attempted. UseSubject.sink
/Subject
itself for adding events. -
Change return type of
ReplaySubject<T>.stream
toReplayStream<T>
. -
Internal refactoring of
Subject.addStream
.
-
What's Changed
- fix(subject): only call
onAdd
andonError
if the subject is not closed by @hoc081098 in #698 - refactor(subject):
Subject.stream
now returns a read-onlyStream
by @hoc081098 in #699 - refactor(subject): addStream by @hoc081098 in #700
- chore(publish): prepare for v0.27.7 by @hoc081098 in #701
Full Changelog: 0.27.6...0.27.7
0.27.6
https://pub.dev/packages/rxdart/versions/0.27.6
-
Rx.using
/UsingStream
:resourceFactory
can now return aFuture
.
This allows for asynchronous resource creation. -
Rx.range
/RangeStream
: ensureRangeStream
is only listened to once.
What's Changed
- fix(range): make sure
RangeStream
can only be listened to once by @hoc081098 in #690 - fix(range): ensure RangeStream is only listened to once by @hoc081098 in #694
- refactor(Rx.using):
resourceFactory
can return a Future by @hoc081098 in #696 - chore(publish): prepare for v0.27.6 by @hoc081098 in #697
Full Changelog: 0.27.5...0.27.6
0.27.5
https://pub.dev/packages/rxdart/versions/0.27.5
Bug fixes
-
Fix issue #683: Throws runtime type error when using extension
methods on aStream<R>
but its type annotation isStream<T>
,R
is a subtype ofT
(covariance issue withStreamTransformer
).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
viastreamTransformer.bind(stream)
to avoid this issue. -
Fix
concatEager
:activeSubscription
should be changed to next subscription.
Code refactoring
- Change return type of
pairwise
toStream<List<T>>
.
What's Changed
- Fix ConcatEagerStream bug by @Stitch-Taotao in #682
- Fix #683 by @hoc081098 in #684
- refactor(pairwise): change return type of pairwise to Stream<List> by @hoc081098 in #685
- Update CHANGELOG.md by @hoc081098 in #686
- prepare for v0.27.5 by @hoc081098 in #688
New Contributors
- @Stitch-Taotao made their first contribution in #682
Full Changelog: 0.27.4...0.27.5
0.27.4
https://pub.dev/packages/rxdart/versions/0.27.4
Bug fixes
withLatestFrom
should iterate overIterable<Stream>
s only once when the stream is listened to.- Fix analyzer warnings when using
Dart 2.16.0
.
Features
- Add
mapNotNull
/MapNotNullStreamTransformer
. - Add
whereNotNull
/WhereNotNullStreamTransformer
.
Documentation
- Fix grammar errors in code examples (thanks to @fzyzcjy).
- Update RxMarbles URL for
RaceStream
(thanks to @PΓ©ter Ferenc Gyarmati).
What's Changed
- test(flatMap): fix flatMap tests by @hoc081098 in #658
- fix(withLatestFrom): should iterate over
Iterable<Stream>
once by @hoc081098 in #662 - fix: analyzer when using Dart 2.16.0 by @hoc081098 in #663
- Fix grammar errors in code examples by @fzyzcjy in #664
- docs: update
rxmarbles
URL forRaceStream
by @peter-gy in #669 - Fix ci error
pub: command not found
by @beeth0ven in #673 - ci: remove deprecated
packages
flag by @beeth0ven in #674 - Create flutter-example.yml by @hoc081098 in #676
- Update flutter-example.yml by @hoc081098 in #677
- Add mapNotNull and whereNotNull by @hoc081098 in #548
- Prepare for v0.27.4 by @hoc081098 in #679
New Contributors
- @fzyzcjy made their first contribution in #664
- @peter-gy made their first contribution in #669
- @beeth0ven made their first contribution in #673
Full Changelog: 0.27.3...0.27.4
0.27.3
https://pub.dev/packages/rxdart/versions/0.27.3
Bug fixes
flatMap
now creates innerStream
s lazily.combineLatest
,concat
,concatEager
,forkJoin
,merge
,race
,zip
iterate overIterable<Stream>
s only once
when the stream is listened to.- Disallow mixing
autoConnect
,connect
andrefCount
together, only one of them should be used.
Features
- Introduce
AbstractConnectableStream
, base class for theConnectableStream
implementations. - Improve
CompositeSubscription
(thanks to @BreX900)- CompositeSubscription's
dispose
,clear
, andremove
methods now return a completion future. - Fixed an issue where a stream not present in CompositeSubscription was canceled.
- Added the ability not to cancel the stream when it is removed from CompositeSubscription.
- CompositeSubscription implements
StreamSubscription
. CompositeSubscription.add
will throw aStateError
instead of aString
if this composite was disposed.
- CompositeSubscription's
Documentation
- Fix
Connectable
examples. - Update Web example to null safety.
- Fix
Flutter
example:SearchResultItem.fromJson
type error (thanks to @WenYeh)
Code refactoring
- Simplify
takeLast
implementation. - Migrate from
pedantic
tolints
andflutter_lints
. - Refactor
BehaviorSubject
,ReplaySubject
implementations by using "Sentinel object
"s instead ofValueWrapper
s.
New Contributors
- @wayne900204 made their first contribution in #627
- @BreX900 made their first contribution in #633
Full Changelog: 0.27.2...0.27.3
0.27.2
https://pub.dev/packages/rxdart/versions/0.27.2
Bug fixes
onErrorReturnWith
now does not drop the remaining data events after the first error.- Disallow changing handlers of
ConnectableStreamSubscription
.
Features
- Add
delayWhen
operator. - Add optional parameter
maxConcurrent
toflatMap
. groupBy
- Rename
GroupByStream
toGroupedStream
. - Add optional parameter
durationSelector
, which used to determine how long each group should exist.
- Rename
ignoreElements
- Remove
@deprecated
annotation (ignoreElements
should not be marked as deprecated). - Change return type to
Stream<Never>
.
- Remove
Documentation
- Update to
PublishSubject
's docs (thanks to @AlexanderJohr).
Code refactoring
- Refactoring Stream Transformers, using
Stream.multi
internally.