// registry of store resets so a sign-out or account switch wipes every
// in-memory cache: no data from one account may survive into the next
// session. factories register themselves; resetAllStores runs from auth

const resets = new Set<() => void>()

export const registerReset = (reset: () => void): void => {
  resets.add(reset)
}

export const resetAllStores = (): void => {
  for (const reset of resets) reset()
}
