package com.live.mylivewallpaper.viewmode;

import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;

public class BaseViewModelStoreOwner implements ViewModelStoreOwner {
    private final static BaseViewModelStoreOwner sInstance = new BaseViewModelStoreOwner();
    private ViewModelStore mAppViewModelStore;

    private BaseViewModelStoreOwner() {
    }

    public static BaseViewModelStoreOwner getInstance() {
        return sInstance;
    }

    @NonNull
    @Override
    public ViewModelStore getViewModelStore() {
        if (mAppViewModelStore == null) mAppViewModelStore = new ViewModelStore();
        return mAppViewModelStore;
    }
}
