// Path: redux-core/src/main/java/me/tatarka/redux/SimpleStore.java
// public class SimpleStore<S> implements Store<S> {
// 
//     private volatile S state;
//     private final CopyOnWriteArrayList<Listener<S>> listeners = new CopyOnWriteArrayList<>();
// 
//     public SimpleStore(S initialState) {
//         setState(initialState);
//     }
// 
//     @Override
//     public S getState() {
//         return state;
//     }
// 
//     @Override
//     public void setState(S newState) {
//         if (!equals(state, newState)) {
//             state = newState;
//             for (Listener<S> listener : listeners) {
//                 listener.onNewState(state);
//             }
//         }
//     }
// 
//     /**
//      * Registers as listener to receive state changes. The current state will be delivered
//      * immediately.
//      */
//     public void addListener(Listener<S> listener) {
//         listeners.add(listener);
//         listener.onNewState(state);
//     }
// 
//     /**
//      * Removes the listener so it no longer receives state changes.
//      */
//     public void removeListener(Listener<S> listener) {
//         listeners.remove(listener);
//     }
// 
//     public interface Listener<S> {
//         /**
//          * Called when a new state is set. This is called on the same thread as  or {@link #setState(Object)}.
//          */
//         void onNewState(S state);
//     }
// 
//     private static boolean equals(Object var0, Object var1) {
//         return var0 == var1 || var0 != null && var0.equals(var1);
//     }
// }


import android.app.Application;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import me.tatarka.redux.SimpleStore;
package me.tatarka.redux.android.lifecycle;



public abstract class StoreAndroidViewModel<S, SR extends SimpleStore<S>> extends AndroidViewModel {

    private final StoreViewModelDelegate<S, SR> delegate;

    public StoreAndroidViewModel(Application application, @NonNull SR store) {
        super(application);
        this.delegate = new StoreViewModelDelegate<>(store);
    }

// Path: redux-core/src/main/java/me/tatarka/redux/SimpleStore.java
// public class SimpleStore<S> implements Store<S> {
// 
//     private volatile S state;
//     private final CopyOnWriteArrayList<Listener<S>> listeners = new CopyOnWriteArrayList<>();
// 
//     public SimpleStore(S initialState) {
//         setState(initialState);
//     }
// 
//     @Override
//     public S getState() {
//         return state;
//     }
// 
//     @Override
//     public void setState(S newState) {
//         if (!equals(state, newState)) {
//             state = newState;
//             for (Listener<S> listener : listeners) {
//                 listener.onNewState(state);
//             }
//         }
//     }
// 
//     /**
//      * Registers as listener to receive state changes. The current state will be delivered
//      * immediately.
//      */
//     public void addListener(Listener<S> listener) {
//         listeners.add(listener);
//         listener.onNewState(state);
//     }
// 
//     /**
//      * Removes the listener so it no longer receives state changes.
//      */
//     public void removeListener(Listener<S> listener) {
//         listeners.remove(listener);
//     }
// 
//     public interface Listener<S> {
//         /**
//          * Called when a new state is set. This is called on the same thread as  or {@link #setState(Object)}.
//          */
//         void onNewState(S state);
//     }
// 
//     private static boolean equals(Object var0, Object var1) {
//         return var0 == var1 || var0 != null && var0.equals(var1);
//     }
// }


// Path: redux-android-lifecycle/src/main/java/me/tatarka/redux/android/lifecycle/StoreAndroidViewModel.java
import android.app.Application;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import me.tatarka.redux.SimpleStore;

package me.tatarka.redux.android.lifecycle;



public abstract class StoreAndroidViewModel<S, SR extends SimpleStore<S>> extends AndroidViewModel {

    private final StoreViewModelDelegate<S, SR> delegate;

    public StoreAndroidViewModel(Application application, @NonNull SR store) {
        super(application);
        this.delegate = new StoreViewModelDelegate<>(store);
    }

    @NonNull