Skip to content

Commit

Permalink
Null-coalesce isDisposedOrDisposing to ease test breakages
Browse files Browse the repository at this point in the history
Some Store mocks in consumer tests don't properly mock `isDisposedOrDisposing`, which results in breakages caused by this new check.

We can fix all those tests here by accounting for this case
  • Loading branch information
greglittlefield-wf authored Jun 16, 2017
1 parent 40f4735 commit e805b79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/component_declaration/flux_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ abstract class _FluxComponentMixin<TProps extends FluxUiProps> implements Batche

handlers.forEach((store, handler) {
String message = 'Cannot listen to a disposed/disposing Store.';
assert(!store.isDisposedOrDisposing, '$message This can be caused by BatchedRedraws '
assert(!(store.isDisposedOrDisposing ?? false), '$message This can be caused by BatchedRedraws '
'mounting the component asynchronously after the store has been disposed. If you are '
'in a test environment, try adding an `await window.animationFrame;` before disposing your '
'store.');
Expand Down

0 comments on commit e805b79

Please sign in to comment.