This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const updateMapLayerByKey = (key) => (context, event) => event.key === key ? event.newValue : context[key] | |
const updateMapLayers = assign({ | |
geos: updateMapLayerByKey('geos'), | |
networkLinks: updateMapLayerByKey('networkLinks'), | |
transitStops: updateMapLayerByKey('transitStops'), | |
transitRoutes: updateMapLayerByKey('transitRoutes'), | |
}) | |
const updateThenLoadTransition = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = () => {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |