_hyperscript icon indicating copy to clipboard operation
_hyperscript copied to clipboard

how to translate this JS code into HS?

Open warcayac opened this issue 1 year ago • 2 comments

document.body.addEventListener("authOk", function(evt){
  console.log(evt.detail.value);  // it displays: 12345
})

I tried with:

_="on authOk js(evt) console.log(evt.detail.value) end"

but it displays error messages only like this:

Cannot read properties of undefined (reading 'detail')

warcayac avatar May 24 '24 02:05 warcayac

on authOk log event.detail.value

i guess. untested

jeanfortheweb avatar May 28 '24 21:05 jeanfortheweb

see https://hyperscript.org/docs/#event_destructuring

_="on authOk(value) log value end"

cruzzed avatar Jul 29 '24 04:07 cruzzed