Returns a constant value wrapped in a cancellable promise. Useful for creating async functions that return fixed values.
The type of the constant value
The constant value to return
Optional
Cancellable configuration options
A cancellable handle that resolves to the constant value
const handle = constant(42);const result = await handle; // 42 Copy
const handle = constant(42);const result = await handle; // 42
Returns a constant value wrapped in a cancellable promise. Useful for creating async functions that return fixed values.