Skip to content

Instantly share code, notes, and snippets.

View lifedraft's full-sized avatar

Stanislav lifedraft

View GitHub Profile
function render(model){
let current_state_name = model.active_states[0].name;
return $("h1",
{style: {color: "darkBlue"}},
`The current state is: ${current_state_name}`);
}
Shipping
FetchDeliveryAddressService*
# context:
# addresses: (filtered for tenant)
# isFilterd: if addresses filtered
# deliveryAddress (prefill: cart billingAddress + deliveryDate => scalar Date)
# selection: uuid | new delivery address | useBillingAsShipping
# billingAddressApplicable: true
done -> Guard
Billing
FetchBilling
# context:
# addresses: (filtered for tenant)
# isFilterd: if empty addresses
# billingAddress (prefill: registrationData | profile | cart billingAddress)
# selection: uuid | new billing address
done -> Guard
Guard
Billing
FetchBilling
done -> Guard
Guard
doneLoggedIn -> LoggedIn
doneGuest -> Guest
LoggedIn
GuardLoggedIn
withoutAddresses -> WithoutAddresses
@lifedraft
lifedraft / machine.js
Last active April 12, 2021 14:19
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@lifedraft
lifedraft / machine.js
Last active October 20, 2020 13:34
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@lifedraft
lifedraft / machine.js
Last active May 11, 2020 09:48
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@lifedraft
lifedraft / machine.js
Last active May 11, 2020 09:19
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@lifedraft
lifedraft / machine.js
Last active May 5, 2020 14:41
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'fetch',
initial: 'query',
states: {
query: {
initial: 'loading',
states: {
loading: {
on: {
@lifedraft
lifedraft / machine.js
Last active March 3, 2020 13:58
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions