Skip to content

Commit 0d2f7dc

Browse files
committed
doc: remove old references
1 parent 650b12e commit 0d2f7dc

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

lib/src/module/module.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ abstract class Module<RouteType, Config extends Object>
117117
!_isInitializing) {
118118
throw StateError(
119119
'Lifecycle-managed injectable ${probe.runtimeType} cannot be resolved '
120-
'before $runtimeType.activate() completes.',
120+
'before $logTag.activate() completes.',
121121
);
122122
}
123123
return builder(_di.get<Config>(), _di.get);

lib/src/repo/mixins/use_repo_mixin.dart

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,47 @@ import 'package:meta/meta.dart';
66
import 'package:grumpy/grumpy.dart';
77

88
/// Provides use hooks for watching and accessing data within [UseRepoMixin.onDependenciesReady].
9+
///
10+
/// {@category repo}
911
class UseHooks {
1012
/// Provides use hooks for watching and accessing data within [UseRepoMixin.onDependenciesReady].
1113
const UseHooks({required this.repo, required this.externalStream});
1214

1315
/// {@template UseHooks.repo}
14-
/// A function that allows you to watch a [Repo] of type [R] managing data of type [S] and
16+
/// Watches a [Repo] of type `R` managing data of type `S` and
1517
/// returns a tuple containing the data from the repo and the repo itself.
1618
///
19+
/// Example usage:
20+
/// ```dart
21+
/// final (counter, counterRepo) = use.repo<int, CounterRepo>();
22+
/// ```
23+
///
24+
/// If the repo does not contain data yet, [UseRepoMixin.onDependenciesReady] is aborted and [UseRepoMixin.onDependenciesLoading] or [UseRepoMixin.onDependencyError] is called instead.
25+
///
1726
/// {@endtemplate}
1827
final Future<(S, R)> Function<S, R extends Repo<S>>() repo;
1928

2029
/// {@template UseHooks.externalStream}
21-
/// A function that watches an external change signal while reading the current
22-
/// value synchronously via [syncSnapshot].
30+
/// Watches an external change signal while reading the current
31+
/// value synchronously via a syncSnapshot callback.
2332
///
24-
/// The [changeSignal] is treated as invalidation-only. Emitted values are
33+
/// Example usage:
34+
/// ```dart
35+
/// final isOnline = use.externalStream<bool>(
36+
/// 'onlineStatus',
37+
/// changeSignal: connectivityService.onConnectivityChanged,
38+
/// syncSnapshot: () => connectivityService.isOnline,
39+
/// );
40+
/// ```
41+
///
42+
/// The changeSignal is treated as invalidation-only. Emitted values are
2543
/// ignored and only used to trigger recomputation.
44+
///
45+
/// If the changeSignal emits an error or syncSnapshot throws, the error will be handled by [UseRepoMixin.onDependencyError].
2646
/// {@endtemplate}
2747
final T Function<T>(
2848
Object key, {
49+
2950
required Stream changeSignal,
3051
required T Function() syncSnapshot,
3152
})
@@ -379,9 +400,9 @@ mixin UseRepoMixin<D, E, L> on LifecycleMixin, LifecycleHooksMixin {
379400
);
380401

381402
/// A callback function that is called when all watched repositories are ready.
382-
/// Call [use.useRepo] within this function to access repositories required to build the value.
403+
/// Call [UseHooks.repo] within this function to access repositories required to build the value.
383404
///
384-
/// [_onDependenciesReady] is called whenever any of the watched repositories emit a new state and *all* watched
405+
/// Called whenever any of the watched repositories emit a new state and *all* watched
385406
/// repositories have a state of [RepoDataState].
386407
///
387408
/// If this function throws an exception, the error will be handled by [onDependencyError].

0 commit comments

Comments
 (0)