import { selectorFamily } from 'recoil';
import dataSourceAtom from '../atoms/dataSource';

/**
 * The `dataSource` family provides a way to select the most recently updated
 * data from multiple sources that can provide it.
 */
const dataSource = selectorFamily({
  key: 'election.selectors.dataSource',
  get: key => ({
    get
  }) => get(dataSourceAtom(key))
});
export default dataSource;