/// <summary> /// Initializes a new instance of the <see cref="ReduxStore{T}" class/> /// </summary> /// <param name="reducer">Reducer to use for state transformations.</param> /// <param name="initialStateFactory">Factory used to create the initial state of the application.</param> public ReduxStore( IReduxReducer <T> reducer, IReduxStateFactory <T> initialStateFactory) { if (initialStateFactory is null) { throw new ArgumentNullException(nameof(initialStateFactory)); } _subscriptions = new SubscriptionMiddleware(this); _reducer = new ReducingMiddleware( reducer ?? throw new ArgumentNullException(nameof(reducer)), initialStateFactory.Create()); _processingQueue = new Cached <ImmutableQueue <IReduxMiddleware> >( CreateProcessingQueue); }
public PlaygroundReduxDispatcher(RootState initialState, IReduxReducer <RootState> reducer) : base(initialState, reducer, TaskScheduler.FromCurrentSynchronizationContext()) { }
public TestDispatcher(RootState initialState, IReduxReducer <RootState> reducer, TaskScheduler notificationScheduler) : base(initialState, reducer, notificationScheduler) { }
public void SetUp() { initialState = new RootState(); reducer = Substitute.For <IReduxReducer <RootState> >(); dispatcher = new TestDispatcher(initialState, reducer, TaskScheduler.Current); }