temporeest
Version:
16 lines (13 loc) • 385 B
text/typescript
/* TODO: maybe just get rid of all this optimistic promise crap.
* Complicates the code and is only a problem because React can't handle async correctly.
*/
export default class OptimisticPromise<T> extends Promise<T> {
// @ts-ignore
get optimistic(): T {
return this.
}
__setOptimisticResult(r: T): void {
this.
}
}