Skip to content

Commit e42f8ec

Browse files
committed
Publish 1.2.0
1 parent b76b086 commit e42f8ec

File tree

6 files changed

+104
-48
lines changed

6 files changed

+104
-48
lines changed

.idea/libraries/Dart_Packages.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 77 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1+
## 1.2.0
2+
3+
- Breaking change: remove `rxdart` dependency
4+
15
## 1.1.0
2-
- Update rxdart
3-
- Now support extension methods
6+
- Update rxdart
7+
- Now support extension methods
48

59
## 1.0.1+1
6-
- Update dependencies
7-
- Update example
10+
- Update dependencies
11+
- Update example
812

913
## 1.0.1
10-
- Update dependencies
11-
- Some minor changes
14+
- Update dependencies
15+
- Some minor changes
1216

1317
## 1.0.0+1
14-
- Only change description
18+
- Only change description
1519

1620
## 1.0.0
1721

18-
- Add document, README, tests and some changes
22+
- Add document, README, tests and some changes
1923

20-
## 0.0.9
24+
## 0.0.9
2125

2226
- Initial version, created by Stagehand

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
66

77
Port from [RxRedux-freeletics](https://github.com/freeletics/RxRedux)
8-
9-
A Redux store implementation entirely based on RxDart (inspired by [redux-observable](https://redux-observable.js.org))
8+
A Redux store implementation entirely based on Dart `Stream`, with the power of RxDart (inspired by [redux-observable](https://redux-observable.js.org))
109
that helps to isolate side effects. RxRedux is (kind of) a replacement for RxDart's `.scan()` operator.
1110

1211
![RxRedux In a Nutshell](https://raw.githubusercontent.com/freeletics/RxRedux/master/docs/rxredux.png)
@@ -19,7 +18,7 @@ dependencies:
1918
```
2019
2120
## How is this different from other Redux implementations
22-
In contrast to any other Redux inspired library out there, this library is really backed on top of RxDart.
21+
In contrast to any other Redux inspired library out there, this library is pure backed on top of Dart Stream.
2322
This library offers a custom stream transformer `ReduxStoreStreamTransformer` (or extension method `reduxStore`) and treats upstream events as `Actions`.
2423

2524
# Redux Store

lib/src/redux_store_stream_transformer.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import 'package:meta/meta.dart';
44
import 'package:rx_redux/src/reducer.dart';
55
import 'package:rx_redux/src/reducer_exception.dart';
66
import 'package:rx_redux/src/side_affect.dart';
7-
import 'package:rxdart/rxdart.dart';
87

98
extension ReduxStoreExt<Action> on Stream<Action> {
109
/// A ReduxStore is a RxDart based implementation of Redux and redux-observable.js.org.
@@ -88,9 +87,9 @@ class ReduxStoreStreamTransformer<A, S> extends StreamTransformerBase<A, S> {
8887
final len = sideEffects.length;
8988
final sideEffectSubscriptions = List<StreamSubscription<A>>(len);
9089

91-
final actionSubject = PublishSubject<A>();
92-
final addActionToSubject = actionSubject.add;
93-
final addErrorToSubject = actionSubject.addError;
90+
final actionController = StreamController<A>.broadcast();
91+
final addActionToSubject = actionController.add;
92+
final addErrorToSubject = actionController.addError;
9493

9594
StreamController<S> controller;
9695
StreamSubscription<A> subscriptionUpstream;
@@ -120,8 +119,8 @@ class ReduxStoreStreamTransformer<A, S> extends StreamTransformerBase<A, S> {
120119
if (!controller.isClosed) {
121120
controller.close();
122121
}
123-
if (!actionSubject.isClosed) {
124-
actionSubject.close();
122+
if (!actionController.isClosed) {
123+
actionController.close();
125124
}
126125
}
127126

@@ -134,7 +133,7 @@ class ReduxStoreStreamTransformer<A, S> extends StreamTransformerBase<A, S> {
134133
controller.add(state);
135134

136135
// This will make the reducer run on each action
137-
subscriptionActionSubject = actionSubject.listen(
136+
subscriptionActionSubject = actionController.stream.listen(
138137
onDataActually,
139138
onError: onErrorActually,
140139
);
@@ -150,7 +149,7 @@ class ReduxStoreStreamTransformer<A, S> extends StreamTransformerBase<A, S> {
150149
var i = 0;
151150
for (final sideEffect in sideEffects) {
152151
sideEffectSubscriptions[i] = sideEffect(
153-
actionSubject,
152+
actionController.stream,
154153
stateAccessor,
155154
).listen(
156155
addActionToSubject,

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name: rx_redux
2-
description: A library that manages state using RxDart. Redux implementation based on RxDart
3-
version: 1.1.0
2+
description: A library that manages state using Dart Stream. Redux implementation based on Dart Stream, with the power of RxDart.
3+
version: 1.2.0
44
homepage: https://github.com/hoc081098/rx_redux.git
55
issue_tracker: https://github.com/hoc081098/rx_redux/issues
66

77
environment:
88
sdk: '>=2.6.0 <3.0.0'
99

1010
dependencies:
11-
rxdart: ^0.23.1
1211
meta: ^1.1.6
1312

1413
dev_dependencies:
1514
pedantic: ^1.0.0
1615
test: ^1.0.0
16+
rxdart: ^0.24.0

0 commit comments

Comments
 (0)