-
Notifications
You must be signed in to change notification settings - Fork 472
dbeaver/pro#6327 refactor: sql editor & vqb #3742
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Conversation
markOutdated(): void; | ||
} | ||
|
||
export function useSync(callback: () => void | Promise<void>): ISyncHook { |
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.
The name of this hook is too generic. Could we give it a more explicit name so it’s clearer why we need it?
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.
I agree; it's generic (and it's really generic), but I can't imagine another name. This hook aims to provide a simple way to implement a React-based reaction to side effects. Generally, we have imperative code that will invoke the function right away. This leads to problems when an event might be called multiple times, so we will have numerous functions running in concurrent mode.
That leads to problems like this one you fixed earlier: #3734
useSync
"connects" events with React lifecycle, so the interface can react to changes in a React manner by utilizing React's built-in batching functionality.
webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorTabService.ts
Show resolved
Hide resolved
c8ef08b
7854d52
closes dbeaver/pro#6327
closes dbeaver/pro#5174
closes dbeaver/pro#4922