-
Notifications
You must be signed in to change notification settings - Fork 120
[PE-6156] Deprecate fetch collections #12148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
export function* queryTrack(id: ID | null | undefined, forceRetrieve = false) { | ||
if (!id) return null | ||
const queryClient = yield* getContext('queryClient') | ||
return queryClient.getQueryData(getTrackQueryKey(id)) | ||
const sdk = yield* getSDK() | ||
const currentUserId = yield* select(getUserId) | ||
const dispatch = yield* getContext('dispatch') | ||
|
||
const queryData = yield* call([queryClient, queryClient.fetchQuery], { | ||
queryKey: getTrackQueryKey(id), | ||
queryFn: async () => | ||
getTrackQueryFn(id!, currentUserId, queryClient, sdk, dispatch), | ||
staleTime: forceRetrieve ? 0 : undefined | ||
}) | ||
|
||
return queryData as TQTrack | undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this stuff already on main?
export const resetCollection = (): ResetCollectionAction => ({ | ||
type: RESET_COLLECTION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the context here?
|
||
const TRACKS_BATCH_LIMIT = 200 | ||
|
||
export function* retrieveTracksForCollections( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we're moving this around can we rename it queryTracksForCollection
trackIds: allSavedTrackIds.filter((id) => id !== null) | ||
}) | ||
const tracks = yield* call( | ||
// @ts-ignore - Mobile for some reason fails to type-check this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😞
|
Description
Deprecates fetch collections similar to tracks.