Skip to content
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

allow OnRenderFn be async and use Promises #2985

Closed
wants to merge 3 commits into from

Conversation

revintec
Copy link
Contributor

@revintec revintec commented Feb 15, 2023

allow component$(...) to use async functions as callback, thus simplifying server code
this would also align its signature more with useBrowserVisibleTask$(...)(originally useClientEffect$(...)

What is it?

  • Feature / enhancement

Description

fixes https://github.com/BuilderIO/qwik/issues/2765

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality -- only changes function signature, in a backward compatible way

allow `OnRenderFn` be async and use `Promise`s
@stackblitz
Copy link

stackblitz bot commented Feb 15, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@revintec revintec marked this pull request as ready for review February 15, 2023 17:52
@manucorporat
Copy link
Contributor

it's not a practice we recommend! in fact we might error if you detect promises at component$, why do you need to await inside a component$ callback?

@revintec
Copy link
Contributor Author

@manucorporat sorry for replying late, let's continue discussion here https://github.com/BuilderIO/qwik/issues/2765

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants