Hacker News new | ask | show | jobs
by recursivedoubts 598 days ago
You can't achieve that with the intended semantics directly in hyperscript, because it will resolve all argument promises before invoking Promise.race()

You could move that out to JavaScript and then call that function from hyperscript:

  set result to jsPromiseRace()
it could also be done as inline js:

  js
    return Promise.race(job1(), job2());
  end
  log the result
but I think if you are writing this style of code it makes more sense to just kick out to JavaScript for it.