package com.sound.prankparty.Utils;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;

import com.sound.prankparty.Room.AppDatabase;
import com.sound.prankparty.Room.FavoriteSounds;

import java.util.List;

public class FavoriteSoundsViewModel extends AndroidViewModel {

    private LiveData<List<FavoriteSounds>> favoriteSoundsLiveData;
    private AppDatabase appDatabase;

    public FavoriteSoundsViewModel(@NonNull Application application) {
        super(application);
        appDatabase = AppDatabase.getDatabase(application);
        favoriteSoundsLiveData = appDatabase.favoriteSoundsDao().getAllSoundsLiveData();
    }

    public LiveData<List<FavoriteSounds>> getFavoriteSoundsLiveData() {
        return favoriteSoundsLiveData;
    }
}


