Skip to content

Commit 9284d85

Browse files
committed
Show Manager class in comparison example
Added manager region to comparison example and included it in the documentation so readers can see where the combined 'bothPositive' observable comes from.
1 parent d7ee618 commit 9284d85

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

code_samples/lib/watch_it/multiple_values_comparison_example.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:watch_it/watch_it.dart' hide di;
33
import 'package:listen_it/listen_it.dart';
44
import '_shared/stubs.dart';
55

6+
// #region manager
67
class Manager {
78
final value1 = ValueNotifier<int>(0);
89
final value2 = ValueNotifier<int>(0);
@@ -13,6 +14,7 @@ class Manager {
1314
(v1, v2) => v1 > 0 && v2 > 0,
1415
);
1516
}
17+
// #endregion manager
1618

1719
// #region separate_watches
1820
class SeparateWatchesWidget extends WatchingWidget {

docs/documentation/watch_it/watching_multiple_values.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ When you have multiple event sources of the **same type** that should trigger th
6969

7070
## Comparison: When to Use Each Approach
7171

72-
Let's see both approaches side by side:
72+
Let's see both approaches side by side with the same Manager class:
73+
74+
<<< @/../code_samples/lib/watch_it/multiple_values_comparison_example.dart#manager
7375

7476
<<< @/../code_samples/lib/watch_it/multiple_values_comparison_example.dart#separate_watches
7577

0 commit comments

Comments
 (0)