2023-03-14 13:18:55 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2020-07-09 09:08:47 +00:00
|
|
|
export default {
|
|
|
|
id: 'data-writer',
|
|
|
|
initial: 'idle',
|
|
|
|
states: {
|
|
|
|
idle: {
|
|
|
|
on: {
|
|
|
|
PERSIST: {
|
|
|
|
target: 'persisting',
|
|
|
|
},
|
|
|
|
REMOVE: {
|
|
|
|
target: 'removing',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
removing: {
|
|
|
|
on: {
|
|
|
|
SUCCESS: {
|
|
|
|
target: 'removed',
|
|
|
|
},
|
|
|
|
ERROR: {
|
|
|
|
target: 'error',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
persisting: {
|
|
|
|
on: {
|
|
|
|
SUCCESS: {
|
|
|
|
target: 'persisted',
|
|
|
|
},
|
|
|
|
ERROR: {
|
|
|
|
target: 'error',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
removed: {
|
|
|
|
on: {
|
|
|
|
RESET: {
|
|
|
|
target: 'idle',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
persisted: {
|
|
|
|
on: {
|
|
|
|
RESET: {
|
|
|
|
target: 'idle',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
error: {
|
|
|
|
on: {
|
|
|
|
RESET: {
|
|
|
|
target: 'idle',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|