Suspends rendering until an executor satisfies a predicate.
The value stored by the executor.
The executors to get value of.
The predicate which a pending executor must conform to suspend the rendering process. By default, only non-fulfilled executors are awaited.
The executor value.
// Suspend if executor is pending or get the current valueconst value = useExecutorSuspense(useExecutor('test', heavyTask)).get(); Copy
// Suspend if executor is pending or get the current valueconst value = useExecutorSuspense(useExecutor('test', heavyTask)).get();
const cheeseExecutor = useExecutor('cheese', buyCheeseTask);const beadExecutor = useExecutor('bread', bakeBreadTask);// Executors run in parallel and rendering is suspended until both of them are settleduseExecutorSuspense(cheeseExecutor);useExecutorSuspense(breadExecutor); Copy
const cheeseExecutor = useExecutor('cheese', buyCheeseTask);const beadExecutor = useExecutor('bread', bakeBreadTask);// Executors run in parallel and rendering is suspended until both of them are settleduseExecutorSuspense(cheeseExecutor);useExecutorSuspense(breadExecutor);
Suspends rendering until an executor satisfies a predicate.