Skip to content

Commit

Permalink
Make SOT optional in the Stock constructor (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirland authored Nov 18, 2022
1 parent 239090a commit 5e5aede
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/dart-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Install dependencies
run: dart pub get

- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .

- name: Analyze project source
- name: Dart Analyze project source
run: dart analyze --fatal-infos

- name: Flutter Analyze project source
run: flutter analyze .

- name: Analyze project source - Code Metrics
run: |
result=$(dart run dart_code_metrics:metrics analyze lib --fatal-style --fatal-performance --fatal-warnings)
Expand Down
2 changes: 1 addition & 1 deletion lib/src/stock.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class Stock<Key, T> {
/// Stock constructor
factory Stock({
required Fetcher<Key, T> fetcher,
required SourceOfTruth<Key, T>? sourceOfTruth,
SourceOfTruth<Key, T>? sourceOfTruth,
}) =>
StockImpl<Key, T>(fetcher: fetcher, sourceOfTruth: sourceOfTruth);

Expand Down
5 changes: 1 addition & 4 deletions test/store_valid_result_store_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ void main() {
test('Test a stock with only a stream fetcher', () async {
final fetcher =
Fetcher.ofStream((int key) => Stream.fromIterable([1, 2, 3]));
final stock = Stock<int, int>(
fetcher: fetcher,
sourceOfTruth: null,
);
final stock = Stock<int, int>(fetcher: fetcher);

final resultList = await stock.getFreshResult(1);
expect(
Expand Down

0 comments on commit 5e5aede

Please sign in to comment.