call method

  1. @override
T call()
override

Lazily evaluates the function passed into the constructor.

Implementation

@override
T call() {
  (T,)? cacheResult = _cache[this] as (T,)?;
  if (cacheResult != null) return cacheResult.$1;
  T funcResult = _func();
  _cache[this] = (funcResult,);
  return funcResult;
}