aidenybai / aidenybai/hacky-js
feat: async generator functions / async components
Đang mở
- Ngôn ngữ chính
- TypeScript
- Star
- 48
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.