Download spectrum/api/loaders/community.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/loaders/community.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/api/loaders/community.js
-
curl -L -o community.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/loaders/community.js
1.06 kB
| // @flow | |
| import { | |
| getCommunities, | |
| getCommunitiesBySlug, | |
| getCommunitiesChannelCounts, | |
| getCommunitiesMemberCounts, | |
| } from '../models/community'; | |
| import { getCommunitiesSettings } from '../models/communitySettings'; | |
| import createLoader from './create-loader'; | |
| export const __createCommunityLoader = createLoader(communities => | |
| getCommunities(communities) | |
| ); | |
| export const __createCommunityBySlugLoader = createLoader( | |
| communities => getCommunitiesBySlug(communities), | |
| 'slug' | |
| ); | |
| export const __createCommunityMemberCountLoader = createLoader( | |
| communityIds => getCommunitiesMemberCounts(communityIds), | |
| 'group' | |
| ); | |
| export const __createCommunityChannelCountLoader = createLoader( | |
| communityIds => getCommunitiesChannelCounts(communityIds), | |
| 'group' | |
| ); | |
| export const __createCommunitySettingsLoader = createLoader( | |
| communityIds => getCommunitiesSettings(communityIds), | |
| key => key.communityId | |
| ); | |
| export default () => { | |
| throw new Error( | |
| '⚠️ Do not import loaders directly, get them from the GraphQL context instead! ⚠️' | |
| ); | |
| }; | |