Skip to content

Commit

Permalink
Minor documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
JaffaKetchup committed Mar 24, 2024
1 parent a8147ae commit adf13f3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions lib/src/backend/impls/objectbox/backend/internal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ part of 'backend.dart';

/// Internal implementation of [FMTCBackend] that uses ObjectBox as the storage
/// database
///
/// Actual implementation performed by `_worker` via `_ObjectBoxBackendImpl`.
abstract interface class FMTCObjectBoxBackendInternal
implements FMTCBackendInternal {
static final _instance = _ObjectBoxBackendImpl._();
Expand Down Expand Up @@ -84,6 +86,8 @@ class _ObjectBoxBackendImpl implements FMTCObjectBoxBackendInternal {

try {
// Not using yield* as it doesn't allow for correct error handling
// (because result must be 'evaluated' here, instead of a direct
// passthrough)
await for (final evt in controller.stream) {
// Listen to responses
yield evt;
Expand Down
11 changes: 5 additions & 6 deletions lib/src/backend/interfaces/backend/internal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ abstract interface class FMTCBackendInternal
/// {@template fmtc.backend.setMetadata}
/// Set a key-value pair in the metadata for the specified store
///
/// Note that this operation will override the stored value if there is already
/// a matching key present.
/// Note that this operation will overwrite any existing value for the
/// specified key.
///
/// Prefer using [setBulkMetadata] when setting multiple keys. Only one backend
/// operation is required to set them all at once, and so is more efficient.
Expand All @@ -234,8 +234,8 @@ abstract interface class FMTCBackendInternal
/// {@template fmtc.backend.setBulkMetadata}
/// Set multiple key-value pairs in the metadata for the specified store
///
/// Note that this operation will override the stored value if there is already
/// a matching key present.
/// Note that this operation will overwrite any existing value for each
/// specified key.
/// {@endtemplate}
Future<void> setBulkMetadata({
required String storeName,
Expand Down Expand Up @@ -304,8 +304,7 @@ abstract interface class FMTCBackendInternal
});

/// {@template fmtc.backend.watchStores}
/// Watch for changes in the specified stores, or all stores if no stores
/// are provided
/// Watch for changes in the specified stores
///
/// Useful to update UI only when required, for example, in a `StreamBuilder`.
/// Whenever this has an event, it is likely the other statistics will have
Expand Down
2 changes: 2 additions & 0 deletions lib/src/root/statistics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class RootStats {
}

/// {@macro fmtc.backend.watchStores}
///
/// If [storeNames] is empty, changes will be watched in all stores.
Stream<void> watchStores({
List<String> storeNames = const [],
bool triggerImmediately = false,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/store/statistics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class StoreStats {
/// {@macro fmtc.frontend.storestats.efficiency}
Future<int> get hits => all.then((a) => a.hits);

/// Retrieve number of unsuccessful tile retrievals when browsing
/// Retrieve the number of unsuccessful tile retrievals when browsing
///
/// {@macro fmtc.frontend.storestats.efficiency}
Future<int> get misses => all.then((a) => a.misses);
Expand Down

0 comments on commit adf13f3

Please sign in to comment.