@Test public void dispatchToReducer() { Mockito.when(reducer.reduce(Mockito.any(State.class), Mockito.any(Action.class))).thenReturn(state); reduxStore.replaceReducer(reducer); reduxStore.dispatchToReducer(action); Mockito.verify(reducer, Mockito.times(1)).reduce(state, action); Mockito.verify(dispatchProcessor, Mockito.times(1)).setNewState(state); }
@WorkerThread protected void dispatchToReducer(@NonNull A action) { if (rootReducer != null) { state = rootReducer.reduce(state, action); if (dispatchProcessor != null) { dispatchProcessor.setNewState(state); } } }
ReduxStore implements Store<S, A> { @WorkerThread protected void dispatchToReducer(@NonNull A action) { if (rootReducer != null) { state = rootReducer.reduce(state, action); if (dispatchProcessor != null) { dispatchProcessor.setNewState(state); } } } }
ReduxStore implements Store<S, A> { @WorkerThread protected void dispatchToReducer(@NonNull A action) { if (rootReducer != null) { state = rootReducer.reduce(state, action); if (dispatchProcessor != null) { dispatchProcessor.setNewState(state); } } } @SafeVarargs  ReduxStore(@NonNull S initialState, @NonNull Reducer<S, A> reducer, @Nullable Middleware<S, A>... middlewareList); }
ReduxStore implements Store<S, A> { @WorkerThread protected void dispatchToReducer(@NonNull A action) { if (rootReducer != null) { state = rootReducer.reduce(state, action); if (dispatchProcessor != null) { dispatchProcessor.setNewState(state); } } } @SafeVarargs  ReduxStore(@NonNull S initialState, @NonNull Reducer<S, A> reducer, @Nullable Middleware<S, A>... middlewareList); @AnyThread boolean subscribe(@NonNull StateSubscriber<S> stateSubscriber); @AnyThread boolean unsubscribe(@NonNull StateSubscriber<S> stateSubscriber); @MainThread @Override void dispatch(@NonNull final A action); @NonNull @Override S getState(); @Override void replaceReducer(@NonNull Reducer<S, A> nextReducer); @MainThread void restoreState(@NonNull S nextState); @AnyThread void destroy(); }
ReduxStore implements Store<S, A> { @WorkerThread protected void dispatchToReducer(@NonNull A action) { if (rootReducer != null) { state = rootReducer.reduce(state, action); if (dispatchProcessor != null) { dispatchProcessor.setNewState(state); } } } @SafeVarargs  ReduxStore(@NonNull S initialState, @NonNull Reducer<S, A> reducer, @Nullable Middleware<S, A>... middlewareList); @AnyThread boolean subscribe(@NonNull StateSubscriber<S> stateSubscriber); @AnyThread boolean unsubscribe(@NonNull StateSubscriber<S> stateSubscriber); @MainThread @Override void dispatch(@NonNull final A action); @NonNull @Override S getState(); @Override void replaceReducer(@NonNull Reducer<S, A> nextReducer); @MainThread void restoreState(@NonNull S nextState); @AnyThread void destroy();  }