-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: async generator functions / async components #3
Comments
This would be cool to support, but I'm not exactly sure how to implement this at the moment. I'll look into how Crank.js implements this feature. |
@aidenybai I'd imagine something like this applied to https://github.com/aidenybai/hacky/blob/105fa12777990b7680c4964beea142392a772bc9/src/component.ts and then likely other changes to add - data.diff = () => {
+ data.diff = async () => {
- const next = <VNode | VNode[]>component.next().value;
+ const next = await (await <VNode | VNode[]>component.next()).value;
if (Array.isArray(next)) {
return <VNode>h('_', undefined, ...next);
} else {
return <VNode>next;
}
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, thanks for your work on this lib.
Crank.js allows components to be defined as async generator functions. For example:
Can Hacky support it too? It seems it would be mostly a matter of adding
await
in some parts of the code.The text was updated successfully, but these errors were encountered: