aidenybai / aidenybai/hacky-js

feat: async generator functions / async components

Aperta
#3 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
48
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hey, thanks for your work on this lib.

Crank.js allows components to be defined as [async generator functions](https://crank.js.org/guides/async-components). For example:
```js
async function IPAddress () {
const res = await fetch("https://api.ipify.org");
const address = await res.text();
return

Your IP Address: {address}
;
}

await renderer.render(, document.body);
console.log(document.body.innerHTML); //

Your IP Address: 127.0.0.1

```

Can Hacky support it too? It seems it would be mostly a matter of adding `await` in some parts of the code.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.