Skip to content

Commit f13bfd0

Browse files
committed
✨ update documentation to include error handling for stream value retrieval
1 parent 4372789 commit f13bfd0

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

packages/hyper_storage/lib/src/hyper_storage.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,13 @@ class HyperStorage extends _HyperStorageImpl {
390390
/// The stream will emit the current value of the key and will update
391391
/// whenever the value changes.
392392
///
393-
/// It is important to close the stream when it is no longer needed
394-
/// to avoid memory leaks.
393+
/// If an error occurs during value retrieval (either initial or on updates),
394+
/// the error will be emitted to the stream. Listeners should provide an
395+
/// [onError] callback to handle such errors gracefully.
395396
///
396-
/// This can be done by cancelling the subscription to the stream.
397+
/// It is important to close the stream when it is no longer needed
398+
/// to avoid memory leaks. This can be done by cancelling the subscription
399+
/// to the stream.
397400
///
398401
/// Note that only supported types are allowed for [E].
399402
/// Supported types are:

packages/hyper_storage/lib/src/hyper_storage_container.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,13 @@ final class HyperStorageContainer extends StorageContainer with ItemHolderMixin,
262262
/// The stream will emit the current value of the key and will update
263263
/// whenever the value changes.
264264
///
265-
/// It is important to close the stream when it is no longer needed
266-
/// to avoid memory leaks.
265+
/// If an error occurs during value retrieval (either initial or on updates),
266+
/// the error will be emitted to the stream. Listeners should provide an
267+
/// [onError] callback to handle such errors gracefully.
267268
///
268-
/// This can be done by cancelling the subscription to the stream.
269+
/// It is important to close the stream when it is no longer needed
270+
/// to avoid memory leaks. This can be done by cancelling the subscription
271+
/// to the stream.
269272
///
270273
/// Note that only supported types are allowed for [E].
271274
/// Supported types are:

0 commit comments

Comments
 (0)