// Available variables: // - Machine // - interpret // - assign // - send // - sendParent // - spawn // - raise // - actions // - XState (all XState exports) const fetchMachine = Machine({ id: 'contactChunks', initial: 'idle', states: { idle: { on: { FETCHED: 'loading', ALREADY_FETCHED:'selector', } }, loading: { on: { RESOLVED: 'selector', REJECTED: 'error' } }, selector: { onEntry: ['deduplicate', 'preSelect'], on: { SELECTED: 'selector', CANCELLED: 'idle', REVEALED_MORE:'selector', } }, error: { on: { RETRIED: 'loading' } } } });