Files
SjkScripts/Functional/Cache.cs
ronnie 262b76c4d5
All checks were successful
Build NuGet / build (push) Successful in 1m43s
Refactored Option<T> to have opertator lifting and removed ref struct for now.
2026-08-07 12:58:11 -04:00

17 lines
525 B
C#

namespace SJK.Functional;
// [Obsolete]
// public class Cache<T> where T : class
// {
// private T? _cache;
// private Func<T> _provider;
// private readonly Func<T, bool>? _isvalid;
// public Cache(Func<T> provider, Func<T, bool>? isvalid = null)
// {
// _provider = provider;
// _isvalid = isvalid;
// }
// public bool IsCached() => _cache is not null;
// public T Value => _cache is null || (_isvalid is not null && !_isvalid(_cache)) ? _cache = _provider() : _cache;
// }