/**
 * Simple shared state bus: HistoryView sets an activity to edit,
 * ActivityView picks it up on mount / route enter.
 */
import { ref } from "vue";

const pending = ref(null);

export function useSportsEditBus() {
  function set(act) {
    pending.value = act;
  }

  function consume() {
    const act = pending.value;
    pending.value = null;
    return act;
  }

  return { pending, set, consume };
}
