Hacker News new | ask | show | jobs
by depaulagu 1365 days ago
How do you dependency inject a ES module?
1 comments

You'll export a function from your esModule if you want to inject

export const myFn = (...deps) =>

You don't need anything else, for encapsulation you have the EsModule, that what OP meant.

ah, thanks, I thought it was something different.
You have dynamic imports too if you need IoC.