Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
doc: added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
akmalviya03 committed Dec 8, 2023
1 parent 73aca7e commit 99c0748
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/src/async_memoizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -39,9 +41,9 @@ class AsyncMemoizer<T> {
/// 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;

Expand Down

0 comments on commit 99c0748

Please sign in to comment.