-
Notifications
You must be signed in to change notification settings - Fork 323
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
Wrap asset creation in a Promise #11396
base: develop
Are you sure you want to change the base?
Conversation
…eation loading state
return useEventCallback( | ||
async ( | ||
name: string, | ||
value: string, | ||
parentId: DirectoryId, | ||
parentPath: string | null | undefined, | ||
) => { |
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.
not sure if these shouldbe useMutation
instead of useEventCallback
. @MrFlashAccount wdyt?
const newProjectRaw = useNewProject(backend, category) | ||
const newProjectMutation = useMutation({ | ||
mutationKey: ['newProject'], | ||
mutationFn: async ([templateId, templateName]: [ | ||
templateId: string | null | undefined, | ||
templateName: string | null | undefined, | ||
]) => { | ||
const parent = getTargetDirectory() | ||
return await newProjectRaw( | ||
{ templateName, templateId }, | ||
parent?.directoryId ?? rootDirectoryId, | ||
parent?.path, | ||
) | ||
}, | ||
}) |
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.
@MrFlashAccount currently when we want to use the new hooks as a mutation they are wrapped into a mutation manually
also let me know if some of these functions should take a single object instead |
Pull Request Description
Important Notes
None
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
The documentation has been updated, if necessary.Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
Unit tests have been written where possible.or the Snowflake database integration, a run of the Extra Tests has been scheduled.