Internal
Synchronous version of ResolveOnce for functions that return non-promise values.
This class is used internally by ResolveOnce when it detects a synchronous function. It executes the function once and caches the result or error for subsequent calls.
The return type
Optional context type
Readonly
Gets the cached value if available.
Gets the cached error if one occurred.
Returns true if the function has been executed.
Executes the function once and caches the result. Subsequent calls return the cached value without re-executing.
The function to execute
The result of the function
Error if the function returned a promise (use AsyncResolveOnce instead)
Resets the cached state, allowing the function to be executed again.
Optional
Optional function to execute immediately after reset
The result if fn provided, undefined otherwise
Synchronous version of ResolveOnce for functions that return non-promise values.
This class is used internally by ResolveOnce when it detects a synchronous function. It executes the function once and caches the result or error for subsequent calls.