Skip to content

Commit 0525bb3

Browse files
committed
deps: rxdart_ext: ^0.2.2, disposebag: ^1.5.1
1 parent a1b6d8b commit 0525bb3

File tree

4 files changed

+125
-443
lines changed

4 files changed

+125
-443
lines changed

.github/workflows/dart.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,59 @@ name: Dart CI
33
on:
44
push:
55
branches: [ master ]
6+
paths-ignore: [ '**.md' ]
67
pull_request:
78
branches: [ master ]
9+
paths-ignore: [ '**.md' ]
10+
schedule:
11+
# Runs at 02:00 UTC on the 1, 4, 7, 10, 13, 16, 19, 22, 25, 28 and 31st of every month.
12+
- cron: "0 2 */3 * *"
13+
workflow_dispatch:
814

915
jobs:
1016
build:
1117

1218
runs-on: ubuntu-latest
1319

14-
container:
15-
image: google/dart:latest
20+
strategy:
21+
matrix:
22+
sdk: [ beta, stable, 2.15.0, 2.12.0 ]
1623

1724
steps:
18-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
26+
27+
- name: Setup Dart
28+
uses: dart-lang/[email protected]
29+
with:
30+
sdk: ${{ matrix.sdk }}
31+
32+
- name: Print Dart version
33+
run: dart --version
1934

2035
- name: Install dependencies
21-
run: pub get
36+
run: dart pub get
2237

2338
- name: Analyze
39+
if: ${{ matrix.sdk == 'stable' }}
2440
run: dart analyze --fatal-infos --fatal-warnings
2541

2642
- name: Format code
43+
if: ${{ matrix.sdk == 'stable' }}
2744
run: dart format . --set-exit-if-changed
2845

2946
- name: Active coverage
30-
run: pub global activate coverage
47+
run: dart pub global activate coverage
3148

3249
- name: Run tests
33-
run: pub run test test/rx_redux_test.dart
50+
run: dart pub run test test/rx_redux_test.dart --chain-stack-traces
3451

3552
- name: Start Observatory
36-
run: dart --disable-service-auth-codes --enable-vm-service=8111 --pause-isolates-on-exit test/rx_redux_test.dart &
53+
run: dart --disable-service-auth-codes --enable-vm-service=8111 --pause-isolates-on-exit --enable-asserts test/rx_redux_test.dart &
3754

3855
- name: Collect coverage
39-
run: nohup pub global run coverage:collect_coverage --port=8111 --out=coverage.json --wait-paused --resume-isolates
56+
run: nohup dart pub global run coverage:collect_coverage --port=8111 --out=coverage.json --wait-paused --resume-isolates
4057

4158
- name: Format coverage
42-
run: pub global run coverage:format_coverage --lcov --in=coverage.json --out=lcov.info --packages=.packages --report-on=lib
59+
run: dart pub global run coverage:format_coverage --lcov --in=coverage.json --out=lcov.info --report-on=lib
4360

44-
- uses: codecov/codecov-action@v2.1.0
61+
- uses: codecov/codecov-action@v3.1.0

example/selector.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'package:built_collection/built_collection.dart';
22
import 'package:disposebag/disposebag.dart';
3-
import 'package:pedantic/pedantic.dart';
43
import 'package:rx_redux/rx_redux.dart';
54
import 'package:rxdart_ext/state_stream.dart';
65

@@ -147,7 +146,7 @@ void main() async {
147146
reducer: reducer);
148147

149148
// select 2 pieces of state and combine them.
150-
final select2$ = store.select2(
149+
final visibleBooks$ = store.select2(
151150
(s) => s.selectedUser?.id,
152151
(s) => s.allBooks,
153152
(String? userId, BuiltList<Book> books) {
@@ -157,9 +156,7 @@ void main() async {
157156
? books.where((b) => b.userId == userId).toBuiltList()
158157
: books;
159158
},
160-
);
161-
final visibleBooks$ = select2$
162-
.shareState(select2$.value); // TODO: remove select2$ and shareState
159+
).asBroadcastStateStream();
163160

164161
// logging state.
165162
print('~> ${visibleBooks$.value}');
@@ -204,6 +201,8 @@ void main() async {
204201
await store.dispose();
205202
}
206203

204+
void unawaited(Future<void>? future) {}
205+
207206
//
208207
// [END] DEMO
209208
//

0 commit comments

Comments
 (0)