From 99c07488993bb4cca26cd64c977b63a531a24261 Mon Sep 17 00:00:00 2001 From: akmalviya03 Date: Fri, 8 Dec 2023 22:25:58 +0530 Subject: [PATCH] doc: added comments --- lib/src/async_memoizer.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/src/async_memoizer.dart b/lib/src/async_memoizer.dart index 3a2432e..62969ef 100644 --- a/lib/src/async_memoizer.dart +++ b/lib/src/async_memoizer.dart @@ -5,7 +5,9 @@ import 'dart:async'; /// A class for running an asynchronous function exactly once and caching its -/// result. +/// result. If you doesn't want to cache Exception then you can set +/// [_canCacheException] to false. +/// /// /// An `AsyncMemoizer` is used when some function may be run multiple times in /// order to get its result, but it only actually needs to be run once for its @@ -39,9 +41,9 @@ class AsyncMemoizer { /// Whether [runOnce] has been called yet. bool get hasRun => _completer.isCompleted; - ///Default is set to true - ///If we set this variable to false - ///On the initial run, if callback returned the [Exception] + ///Default is set to true. + ///If we set this variable to false. + ///On the initial run, if callback returned the [Exception]. ///Next time, we can reRun the callback for the successful attempt. final bool _canCacheException;