Closed andrefelipeschulle closed 1 year ago
Guys, I would like some help from you, what is the best way to solve a container that has several possible providers, would there be a way to pass some parameter to solve an instance?
import {Foo1} from "./Foo1"; import {Foo2} from "./Foo2"; const containers = { Foo1: Foo1, Foo2: Foo2, }; container.registerSingleton("FooContainer", (value) => { return containers[value]; });
and solve like this?
container.resolve("FooContainer", "foo1");
is there any way to work something like this in tsyringe ?
Guys, I would like some help from you, what is the best way to solve a container that has several possible providers, would there be a way to pass some parameter to solve an instance?
and solve like this?
is there any way to work something like this in tsyringe ?