You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is for long-running tasks that don't resolve from a simple fetch. Endpoint is subscribed (meaning they can use polling or other methods like websockets); then on updates - they check a conditional (function set in endpoint) and if does not pass, throws a promise for next polling frequency.
This will be used for workflow result stream. By using suspense in react 18 the entire flow is very simple - useTransition can simply be used on the workflow button to grab next results.
constWFR=endpoint.extend({condition: (response)=>response.status==='done'})constworkflowResults=useSuspenseCondition(WFR,{ id })const[isPending,startTransition]=useTransition();consthandleRun=useCallback(
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is for long-running tasks that don't resolve from a simple fetch. Endpoint is subscribed (meaning they can use polling or other methods like websockets); then on updates - they check a conditional (function set in endpoint) and if does not pass, throws a promise for next polling frequency.
This will be used for workflow result stream. By using suspense in react 18 the entire flow is very simple - useTransition can simply be used on the workflow button to grab next results.
Beta Was this translation helpful? Give feedback.
All reactions