briancavalier / creed

Sophisticated and functionally-minded async with advanced features: coroutines, promises, ES2015 iterables, fantasy-land
https://briancavalier.github.io/creed
MIT License
273 stars 20 forks source link

Add a note to `coroutine` about when generators are detected. #170

Closed unscriptable closed 6 years ago

unscriptable commented 6 years ago

Not sure if this is useful or not. Let me know if you'd like me to reword it or put it elsewhere in the docs.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling a405f3e6e65f5887af720d7bb3c231221700dc57 on unscriptable:patch-2 into 47a517315ce1cc8bedf5929b78512907cd3bfed6 on briancavalier:master.

briancavalier commented 6 years ago

Thanks! LGTM

Yeah, I don't think there's a way to detect at runtime reliably cross-platform :(

163 (and equivalent TS type defs) is probably the best early-detection solution. I need to get back to that.

bergus commented 6 years ago

Have a look at https://stackoverflow.com/a/19660350/1048572 It doesn't need to be a generator function (function*), it just needs to be a function that returns a generator.