You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
returnsundefined
like not usingasync
at allThe text was updated successfully, but these errors were encountered: