Tuple type of the function arguments.
The resolved type of the Promise returned by the async function.
A FnOnceAsync instance that wraps the function.
const initialize = FnOnceAsync(async () => {
console.log('Initializing...');
await loadResources();
return { ready: true };
});
const result = await initialize.call(); // Logs 'Initializing...', returns { ready: true }
// await initialize.call(); // Throws Error: FnOnceAsync has already been consumed
Creates a
FnOnceAsyncwrapper around an async function, making it callable only once.