InRequestScope не работает должным образом - PullRequest
0 голосов
/ 05 сентября 2018

Помощь с использованием inRequestScope inversifyJS Например:

container.bind<ITransactionManager>(Types.MysqlTransactionManager).to(MysqlTransactionManager).inRequestScope()

...
container.get<ITransactionManager>(Types.MysqlTransactionManager)//call the MysqlTransactionManager constructor and return the instance

container.get<ITransactionManager>(Types.MysqlTransactionManager) //call the constructor one more time and return a new instance

Я хочу, чтобы тот же экземпляр был возвращен при повторном вызове get вместо его повторного создания

...