You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consolidate the team-list responsibility currently split between context.js and account.js into this store. context.js may keep the derived "current route context" role but should read team data from here rather than owning a second copy.
First consumer: migrate the team switcher (primary team-list view) to read list/current via ensureLoaded(), with its skeleton. This is what makes the PR demonstrable.
Store created and normalized, with vitest unit tests.
getTeams/getTeam/membership fetches moved behind store actions.
Team switcher reads the store + skeleton; no direct teamApi there.
PR 1 — data-farm store + first consumer
stores/data-farm/teams.ts, iddata-farm-teams.State:
byId,order(the user's team list),currentTeamId,membershipByTeamId,loadState.Getters:
list,current,get(id),isLoading,isLoaded.Actions:
ensureLoaded()(→getTeams),fetchOne(id)(→getTeam),setCurrent(id),refreshCurrent()(replacescontext.refreshTeam),upsert,remove,applyRealtime,clear.Consolidate the team-list responsibility currently split between
context.jsandaccount.jsinto this store.context.jsmay keep the derived "current route context" role but should read team data from here rather than owning a second copy.First consumer: migrate the team switcher (primary team-list view) to read
list/currentviaensureLoaded(), with its skeleton. This is what makes the PR demonstrable.Store created and normalized, with vitest unit tests.
getTeams/getTeam/membership fetches moved behind store actions.Team switcher reads the store + skeleton; no direct
teamApithere.clear()wired to team switch + logout.