_hyperscript icon indicating copy to clipboard operation
_hyperscript copied to clipboard

evaluating _hyperscript expressions from within JavaScript

Open rozek opened this issue 1 year ago • 2 comments

I know that _hyperscript code may be part of a

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

rozek avatar Aug 10 '24 07:08 rozek

hi, do yo find solution?

YousofSayed avatar Nov 25 '24 21:11 YousofSayed

unfortunately not, I just gave up

rozek avatar Nov 26 '24 04:11 rozek