Skip to content

Commit

Permalink
add comments about the new alternatives
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper committed Sep 29, 2023
1 parent 4d76d29 commit 3064a8d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions static/app/utils/useTeams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ type FetchTeamOptions = {

/**
* Helper function to actually load teams
*
*/
async function fetchTeams(
api: Client,
Expand Down Expand Up @@ -158,6 +159,13 @@ async function fetchTeams(
* loaded, so you should use this hook with the intention of providing specific
* slugs, or loading more through search.
*
* @deprecated use the alternatives to this hook (except for search and pagination)
* new alternatives:
* - useTeamsById({ids: []}) - get teams by id
* - useTeamsById({slugs: []}) - get teams by slug
* - useTeamsById() - just reading from the teams store
* - useUserTeams() - same as `provideUserTeams: true`
*
*/
export function useTeams({limit, slugs, provideUserTeams}: Options = {}) {
const api = useApi();
Expand Down

0 comments on commit 3064a8d

Please sign in to comment.