andrewmunsell / needlepoint

ES6 and beyond dependency injection framework.
MIT License
94 stars 11 forks source link

Supports ES7 (specificially async/await) features? #4

Open ORESoftware opened 8 years ago

ORESoftware commented 8 years ago

I doubt Needlepoint supports async/await because of this:

http://stackoverflow.com/questions/36243840/babel-transpile-getting-arguments-from-outer-function

am I wrong?

andrewmunsell commented 8 years ago

I haven't tested it, but you're probably right about it not working. I'll look into adding support.

ORESoftware commented 8 years ago

I am working on the same problem - let me know if you have any good insights. They way I have "solved" it, is in my API, if it's an async/await function, I know that only one param will be passed to it, so I just injected that one param as the only argument. This is of course works, but it's a special case of working; maybe you can come up with something better. Of course, once ES7 becomes native, it should work again, but there is that interim period to worry about.