import { atom } from 'recoil';

/**
 * Atom for storing the current time for use throughout an app. This ensures
 * that all parts of an app will have a consistent reckoning of what time it is
 * and they won't drift apart from each other.
 *
 * Note that this generally won't be used directly. Instead, components should
 * subscribe to an `interval` selector that will update them at an appropriate
 * interval.
 */
const now = atom({
  key: 'int-style.time.atoms.now',
  default: undefined
});
export default now;