Example from hyperscript.org landing page
Highly interactive user experiences without promises, async/await or callback hell.
Hyperscript transparently handles asynchronous behavior for you.
Demo 1: Wait and Send Event
Click the button to start the countdown...
Demo 2: Fetch JSON Data
Click a button to fetch data...
The Exact Code
<div _="on click wait 5s send hello to .target">
<div _="init fetch https://stuff as json then put result into me">
Using fetch() API...
</div>
Extended Version
<!-- Wait then send event -->
<button _="on click
put 'Waiting...' into .target
wait 3s
send hello to .target">
Wait and Send
</button>
<!-- Fetch and display JSON -->
<button _="on click
put 'Loading...' into #result
fetch https://api.example.com/data as json
put JSON.stringify(it, null, 2) into #result">
Fetch Data
</button>
Features Demonstrated
wait [duration] - Pause execution for specified time
fetch [url] as json - Fetch and parse JSON data
it - Implicit result variable from previous expression