View machine.js
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
View machine.js
const getCheckout = () => Promise.reject({ | |
message: 'There was an error creating your order.', | |
errors: [{ | |
message: "Zip is not valid for Canada", | |
code: "INVALID_FOR_COUNTRY", | |
field:["input","shippingAddress","zip"] | |
}], | |
}) | |
const getShippingRates = () => {} | |
const setShippingRate = () => {} |
View machine.js
const requestCheckout = () => Promise.resolve({ id: '12345', | |
webUrl: 'https://google.com' | |
}) | |
const queryForShippingRates = () => Promise.resolve({ | |
shippingRates: [{test: 'test'}] | |
}) | |
const setShippingRate = () => Promise.resolve() | |
const checkoutMachine = Machine({ | |
id: 'checkout', |