2020-05-11 15:37:11 +00:00
|
|
|
export default {
|
|
|
|
id: 'auth-form',
|
|
|
|
initial: 'idle',
|
|
|
|
on: {
|
|
|
|
RESET: [
|
|
|
|
{
|
|
|
|
target: 'idle',
|
|
|
|
},
|
|
|
|
],
|
2021-11-24 14:53:12 +00:00
|
|
|
ERROR: [
|
|
|
|
{
|
|
|
|
target: 'error',
|
|
|
|
},
|
|
|
|
],
|
2020-05-11 15:37:11 +00:00
|
|
|
},
|
|
|
|
states: {
|
|
|
|
idle: {
|
|
|
|
entry: ['clearError'],
|
|
|
|
on: {
|
|
|
|
SUBMIT: [
|
|
|
|
{
|
|
|
|
target: 'loading',
|
|
|
|
cond: 'hasValue',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
target: 'error',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2021-11-24 14:53:12 +00:00
|
|
|
loading: {},
|
2020-05-11 15:37:11 +00:00
|
|
|
error: {
|
|
|
|
exit: ['clearError'],
|
|
|
|
on: {
|
|
|
|
TYPING: [
|
|
|
|
{
|
|
|
|
target: 'idle',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
SUBMIT: [
|
|
|
|
{
|
|
|
|
target: 'loading',
|
|
|
|
cond: 'hasValue',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
target: 'error',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|