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

/**
 * The `data` family provides a way to select raw data from a data source.
 */
const data = selectorFamily({
  key: 'election.selectors.data',
  get: key => ({
    get
  }) => {
    const source = get(dataSource(key));
    return source.data;
  }
});
export default data;