pub use crate::contexts::merge_readiness::domain::cache::{CachePort, CacheState};
pub(crate) enum DisplayAction {
Display(String),
DisplayAndRefresh(String),
LoadingWithRefresh,
}
pub(crate) fn resolve(repo_id: &str, cache: &impl CachePort) -> DisplayAction {
match cache.check(repo_id) {
CacheState::Fresh(s) => DisplayAction::Display(s),
CacheState::Stale(s) => DisplayAction::DisplayAndRefresh(s),
CacheState::Miss => DisplayAction::LoadingWithRefresh,
}
}