package com.player.musicoo.sp

import android.content.Context
import com.player.musicoo.sp.store.Store
import com.player.musicoo.sp.store.asStoreProvider

class AppStore(context: Context) {
    private val store = Store(
        context
            .getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE)
            .asStoreProvider()
    )

    var searchHistoryStore: Set<String> by store.stringSet(
        key = SEARCH_HISTORY,
        defaultValue = emptySet()
    )

    companion object {
        private const val FILE_NAME = "music_oo_app"
        const val SEARCH_HISTORY = "search_history"
    }
}