SinkFactory
default SinkContainer scope
SinkFactory is default SinkContainer the object which used globally. when using sinking and useSink to connect sink with components, all the sink objects will be generated from SinkFactory
SinkFactory vs SinkContainer
Normally in a single project should use SinkFactory and SinkContainer for testing, also when using it SinkFactory can be directly used because it is a SinkCotainer Instance. but SinkContainer is a constructor.
import { SinkFactory, SinkContainer } from 'redux-sink';
import { CounterSink } from './CounterSink';
const store = SinkFactory.creatStore();
// creat a clean store by a new container
const container = new SinkContainer();
const testStore = container.creatStore();
// this will create a sink inside container instead of SinkFactory
const counter = container.getSink(CounterSink);createStore(SinkConfiguration) => Store
getSink(SinkClass) => SinkInstance
getTasks() => Array<Promise>
getStore() => Store
Last updated
Was this helpful?