1

I am exploring InversifyJS in TypeScript and I want to understand if InversifyJS will work for my use case.

I have a TypeScript project with serverless lambda, Koa. I want to integrate InversifyJS and work on dynamic dependency injection, i.e., with every request, I will get a channel ID.

And based on channelId I want to bind the specific implementation in service layer. Does InversifyJS support this? Which place is the best place to bind the dynamic implementation? Middleware or controller? The InversifyJS container is created even before the server starts, so binding it there is not possible as I have access to the channelId variable in middleware and after that. Does InversifyJS support dynamic injection?

1
  • The bounty attracted a ChatGPT plagiariser. Commented Jul 24, 2023 at 13:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.