@Test public void subscribeDistinctUpdates() { reduxViewModel.subscribe(lifecycleOwner, stateObserver, true); Mockito.verify(distinctLiveData, Mockito.times(1)).observe(ArgumentMatchers.any(), ArgumentMatchers.any()); }
@MainThread public void subscribe(@NonNull LifecycleOwner lifecycleOwner, Observer<S> observer, boolean distinctUntilChanged) { if (distinctUntilChanged) { distinctLiveData.observe(lifecycleOwner, observer); } else { mutableStateLiveData.observe(lifecycleOwner, observer); } }
ReduxViewModel extends AndroidViewModel implements Store<S, A> { @MainThread public void subscribe(@NonNull LifecycleOwner lifecycleOwner, Observer<S> observer, boolean distinctUntilChanged) { if (distinctUntilChanged) { distinctLiveData.observe(lifecycleOwner, observer); } else { mutableStateLiveData.observe(lifecycleOwner, observer); } } }
ReduxViewModel extends AndroidViewModel implements Store<S, A> { @MainThread public void subscribe(@NonNull LifecycleOwner lifecycleOwner, Observer<S> observer, boolean distinctUntilChanged) { if (distinctUntilChanged) { distinctLiveData.observe(lifecycleOwner, observer); } else { mutableStateLiveData.observe(lifecycleOwner, observer); } } ReduxViewModel(@NonNull Application applicationContext); }
ReduxViewModel extends AndroidViewModel implements Store<S, A> { @MainThread public void subscribe(@NonNull LifecycleOwner lifecycleOwner, Observer<S> observer, boolean distinctUntilChanged) { if (distinctUntilChanged) { distinctLiveData.observe(lifecycleOwner, observer); } else { mutableStateLiveData.observe(lifecycleOwner, observer); } } ReduxViewModel(@NonNull Application applicationContext); @MainThread void subscribe(@NonNull LifecycleOwner lifecycleOwner, Observer<S> observer, boolean distinctUntilChanged); @MainThread void unsubscribe(Observer<S> observer); @MainThread @Override void dispatch(@NonNull A action); @Override void replaceReducer(@NonNull Reducer<S, A> nextReducer); @NonNull @Override S getState(); @MainThread void restoreState(@NonNull S state); }
ReduxViewModel extends AndroidViewModel implements Store<S, A> { @MainThread public void subscribe(@NonNull LifecycleOwner lifecycleOwner, Observer<S> observer, boolean distinctUntilChanged) { if (distinctUntilChanged) { distinctLiveData.observe(lifecycleOwner, observer); } else { mutableStateLiveData.observe(lifecycleOwner, observer); } } ReduxViewModel(@NonNull Application applicationContext); @MainThread void subscribe(@NonNull LifecycleOwner lifecycleOwner, Observer<S> observer, boolean distinctUntilChanged); @MainThread void unsubscribe(Observer<S> observer); @MainThread @Override void dispatch(@NonNull A action); @Override void replaceReducer(@NonNull Reducer<S, A> nextReducer); @NonNull @Override S getState(); @MainThread void restoreState(@NonNull S state);  }