v1.2.19
-
FunctionArgs0Extension,FunctionArgs1Extension,FunctionArgs2Extension:tryCall: updated to catch errors from synchronous or asynchronous results and applyonErrorviaFuture.catchErrorif the result is aFuture.
-
ComputeOnce<V>:- Constructor:
- Added static helper
_resolveCallto widen callbacks returningFuture<Never>toFutureOr<V>. - Wrap
_callwith_resolveCallto fixFuture<Never>callbacks.
- Added static helper
- Added
isResolvinggetter to indicate if computation is in progress. - Enhanced
resolvemethod:- Added parameters
throwError,onError, andonErrorValueto control error handling behavior. - Supports returning fallback values or invoking error handlers instead of always throwing.
- Calls
onComputecallback on completion with value or error.
- Added parameters
- Enhanced
resolveAsyncmethod:- Added parameters
throwError,onError, andonErrorValuefor asynchronous error handling. - Calls
onComputecallback on completion.
- Added parameters
- Added
onComputecallback method invoked once computation completes. - Added
classNamegetter and improvedtoStringto reflect current state (resolving, resolved with value, or error).
- Constructor:
-
Added
TimedComputeOnce<V>subclass:- Records the timestamp when computation resolves (success or failure).
- Provides
resolvedAttimestamp andelapsedTimesince resolution. - Overrides
onComputeto set resolution time. - Overrides
classNamefor identification.