- Notifications
You must be signed in to change notification settings - Fork905
feat: setup connection to dynamic parameters websocket#17393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
site/src/modules/workspaces/DynamicParameter/DynamicParameter.tsx OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
site/src/pages/CreateWorkspacePage/CreateWorkspacePageExperimental.tsx OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
site/src/pages/CreateWorkspacePage/CreateWorkspacePageExperimental.tsx OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
site/src/pages/CreateWorkspacePage/CreateWorkspacePageExperimental.tsx OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
site/src/pages/CreateWorkspacePage/CreateWorkspacePageViewExperimental.tsx OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
a39b095
toe04ce2f
Compare266620a
to440fedc
Compareconst sendMessage = (formValues: Record<string, string>) => { | ||
setWSResponseId((prevId) => { | ||
const request: DynamicParametersRequest = { | ||
id: prevId + 1, | ||
inputs: formValues, | ||
}; | ||
if (ws.current && ws.current.readyState === WebSocket.OPEN) { | ||
ws.current.send(JSON.stringify(request)); | ||
return prevId + 1; | ||
} | ||
return prevId; | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
one last thought, I noticed thatonMessage
is wrapped in auseCallback
but this isn't. was that intentional? could be nice to wrap this one as well since it's also being passed as a prop to a child 🤷♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
onMessage was wrapped because its used as a dependency for a useEffect. Sure I can wrap sendMessage as well.
3d787da
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
resolvescoder/preview#57