import { atomFamily } from 'recoil';

/**
 * The `dataSource` atom family keeps track of the contents and metadata of
 * a particular data source loaded from the backend.
 *
 * ```
 * {
 *   metadata: {
 *     type: string,
 *     url: string,
 *     lastUpdated: number,
 *     lastUpdatedHeader: string,
 *     lastUpdatedTimestamp: string,
 *   },
 *   data: {} | [],
 * }
 * ```
 */
const dataSource = atomFamily({
  key: 'int-style.election.atoms.dataSource',
  default: undefined
});
export default dataSource;