package com.pixelized.headache.ui.navigation.home

import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.snapshots.SnapshotStateList
import dagger.hilt.android.scopes.ActivityRetainedScoped

interface HomeDestination

@ActivityRetainedScoped
class HomeNavigator(
    startDestination: HomeDestination,
) {
    val backStack: SnapshotStateList<Any> = mutableStateListOf(startDestination)

    fun popBackstack() = backStack.removeLastOrNull()

    fun goTo(destination: HomeDestination) {
        backStack[0] = destination
    }
}