JSFiddle - React, Tailwind, and code Playground
by Jason Miller
HTML
<script src="https://unpkg.com/[email protected]/dist/greenlet.umd.js"></script>
JavaScript
let getName = greenlet( async username => {
let url = `https://api.github.com/users/${username}`
let res = await fetch(url)
let profile = await res.json()
return profile.name
})
getName('developit').then(console.log, console.error);