3 ms·
Babel does this, using a library called gensync. I have a writeup which goes into more detail: https://writing.bakkot.com/gensync https://writing.bakkot.com/gen
by bakkoting 4y ago
Babel does this, using a library called gensync. I have a writeup which goes into more detail: https://writing.bakkot.com/gensync https://writing.bakkot.com/gensync
gensync instead creates two functions, one sync and one async, which is probably a more familiar API for consumers of your code.