@Test public void onCleared() { reduxViewModel.subscribe(lifecycleOwner, stateObserver, false); reduxViewModel.onCleared(); Mockito.verify(store, Mockito.times(1)).unsubscribe(ArgumentMatchers.any(StateSubscriber.class)); Mockito.verify(store, Mockito.times(1)).destroy(); }
@Override protected void onCleared() { super.onCleared(); store.unsubscribe(subscriber); store.destroy(); }
ReduxViewModel extends AndroidViewModel implements Store<S, A> { @Override protected void onCleared() { super.onCleared(); store.unsubscribe(subscriber); store.destroy(); } }
ReduxViewModel extends AndroidViewModel implements Store<S, A> { @Override protected void onCleared() { super.onCleared(); store.unsubscribe(subscriber); store.destroy(); } ReduxViewModel(@NonNull Application applicationContext); }
ReduxViewModel extends AndroidViewModel implements Store<S, A> { @Override protected void onCleared() { super.onCleared(); store.unsubscribe(subscriber); store.destroy(); } 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> { @Override protected void onCleared() { super.onCleared(); store.unsubscribe(subscriber); store.destroy(); } 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);  }