package com.pixelized.biblib.utils.extention

import android.content.Context
import androidx.annotation.StringRes
import androidx.lifecycle.AndroidViewModel

val AndroidViewModel.context: Context get() = this.getApplication()

fun AndroidViewModel.stringResource(@StringRes id: Int): String {
    return context.getString(id)
}

fun AndroidViewModel.stringResource(@StringRes id: Int, vararg formatArgs: Any): String {
    return context.getString(id, formatArgs)
}