@statezero/core
Version:
The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate
20 lines (19 loc) • 582 B
TypeScript
/**
* Given a live reactive handle and a Promise, wire them together so
* the handle is also thenable.
*
* @template T
* @param {LiveQueryset} live
* @param {Promise<T>} promise
* @returns {LiveQueryset & Promise<T>}
*/
export function makeLiveThenable<T>(live: LiveQueryset, promise: Promise<T>): LiveQueryset & Promise<T>;
/**
* Remove the thenable hooks and clear the optimistic flag in-place, so the object
* can be returned without causing a recursive await loop.
*
* @template T
* @param {T} live
* @returns {T}
*/
export function breakThenable<T>(live: T): T;