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

evaluating _hyperscript expressions from within JavaScript #560

Open
rozek opened this issue Aug 10, 2024 · 2 comments
Open

evaluating _hyperscript expressions from within JavaScript #560

rozek opened this issue Aug 10, 2024 · 2 comments

Comments

@rozek
Copy link
Contributor

rozek commented Aug 10, 2024

I know that _hyperscript code may be part of a <script> element or an attribute of a DOM element.

But how can I evaluate dynamic _hyperscript expressions from within JavaScript (e.g., as part of a REPL)?

window._hyperscript seems to be a function which principally does what I need - but it does not return a Promise in case of asynchronous code (e.g., wait 2s).

And (even more surprising), evaluating async wait 2s log "Hi!" return "Hello, World!" immediately returns "Hello, World!" but waits 2s before logging "Hi!" - what I definitely do not understand...

Thus, how can I evaluate (potentially asynchronous) dynamic(!) _hyperscript expressions from within JavaScript?

Amendment: async do ... end returns undefined like not using async at all

@YousofSayed
Copy link

hi, do yo find solution?

@rozek
Copy link
Contributor Author

rozek commented Nov 26, 2024

unfortunately not, I just gave up

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

No branches or pull requests

2 participants