mirror of https://github.com/status-im/consul.git
53 lines
786 B
JavaScript
53 lines
786 B
JavaScript
export default {
|
|
id: 'auth-form',
|
|
initial: 'idle',
|
|
on: {
|
|
RESET: [
|
|
{
|
|
target: 'idle',
|
|
},
|
|
],
|
|
ERROR: [
|
|
{
|
|
target: 'error',
|
|
},
|
|
],
|
|
},
|
|
states: {
|
|
idle: {
|
|
entry: ['clearError'],
|
|
on: {
|
|
SUBMIT: [
|
|
{
|
|
target: 'loading',
|
|
cond: 'hasValue',
|
|
},
|
|
{
|
|
target: 'error',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
loading: {},
|
|
error: {
|
|
exit: ['clearError'],
|
|
on: {
|
|
TYPING: [
|
|
{
|
|
target: 'idle',
|
|
},
|
|
],
|
|
SUBMIT: [
|
|
{
|
|
target: 'loading',
|
|
cond: 'hasValue',
|
|
},
|
|
{
|
|
target: 'error',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
};
|