{"size": 1463, "ext": "js", "max_stars_repo_path": "api/loaders/community.js", "max_stars_repo_name": "dan-weaver/spectrum", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "api/loaders/community.js", "max_issues_repo_name": "dan-weaver/spectrum", "max_issues_repo_issues_event_min_datetime": "2019-05-06T02:17:45.000Z", "max_issues_repo_issues_event_max_datetime": "2019-07-11T06:23:16.000Z", "max_forks_repo_path": "api/loaders/community.js", "max_forks_repo_name": "dan-weaver/spectrum", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 7, "max_forks_count": null, "avg_line_length": 28.1346153846, "max_line_length": 86, "alphanum_fraction": 0.7894736842}
// @flow
import {
  getCommunities,
  getCommunitiesBySlug,
  getCommunitiesMemberCounts,
  getCommunitiesChannelCounts,
  getCommunitiesOnlineMemberCounts,
} from '../models/community';
import { getCommunitiesSettings } from '../models/communitySettings';
import { getCommunitiesRecurringPayments } from '../models/recurringPayment';
import createLoader from './create-loader';

export const __createCommunityRecurringPaymentsLoader = createLoader(
  communities => getCommunitiesRecurringPayments(communities),
  'group'
);

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 __createCommunityOnlineMemberCountLoader = createLoader(
  communityIds => getCommunitiesOnlineMemberCounts(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! ⚠️'
  );
};
