zaydek / retro-legacy

[WIP] Your friendly neighborhood React static-site generator
MIT License
2 stars 0 forks source link

[Todo] Is there a way to check whether a function is async or not? #34

Closed zaydek closed 3 years ago

zaydek commented 3 years ago

We want to make sure that right now we only support async loaders but everything else should be sync or just non-async code.

zaydek commented 3 years ago

These checks would be added to generated JS code and reported to Go as a stderr errors. It gets a little weird if we want colors in the terminal output, though.

zaydek commented 3 years ago

A better question to ask is: does using await on non-async code blow up?

zaydek commented 3 years ago

This shouldn’t matter in practice. We don’t care whether a function is async or not, simply that it is a function. Anyway, await on non-async code seems to be idempotent.