import { Machine } from 'xstate';
const fetchMachine = Machine({
id: 'fetch',
initial: 'idle',
states: {
idle: {
on: {
FETCH: 'pending'
}
},
pending: {
on: {
RESOLVE: 'resolved',
REJECT: 'rejected'
}
},
resolved: {
type: 'final'
},
rejected: {}
}
});