Injections
Sinks also support injections to its constructor, for better testing and other purpose.
It is possible to inject from @sink
decorator, to decouple the relations for sinks
Inject sink class
Injected sink class will automatically transfer in to sink instance.
Inject SinkFactory
there is a chance that injecting class will not work due to decorators don't work when there circular references, there are workarounds, but not simplified to be solved because redux-sink
does not use reflect-metadata
, and redux-sink
provide object injection.
Inject other objects
because all Sink
use SinkContainer
to create the instance, so we normally cannot access the constructor arguments, so we provide a way to inject other objects.
Last updated