fjorgemota / jimple

Just a dependency injection container to NodeJS and to the browser using new ES6 features
MIT License
75 stars 12 forks source link

Async create strange behavior #56

Closed Poyoman39 closed 4 years ago

Poyoman39 commented 5 years ago

I used to user async function as instance providers, as is :

ioc.set('conf', async() => { return someInstance });

When i use it inside a REACT project, it's working fine, but not when i use it on server side. It may be due to babel or webpack compilation.

What about adding support for async function ? I wrote a small pull request which should do the job (not tested)

fjorgemota commented 5 years ago

Yeah, you're right, babel would probably rewrite your async function so it appears as a normal function to Jimple, because of polyfills and a few rewrites made by regenerator.

Because of this, personally I don't have problems with adding support for async functions. I'll review your PR soon.

fjorgemota commented 4 years ago

Closed by #57.