import { createMachine, assign, sendParent, spawn, send } from 'xstate'; import type { ModalContext, ModalEvent, ModalState, Modal_Event_ToggleInteractiveState } from './types/modal.types'; // ACTIONS // NOte: viz --> https://xstate.js.org/viz/?gist=0df2ab3399ea88a3dbccbd9848f21601 export const modalMachine = createMachine( { id: 'modal', context: {}, initial: 'dormant', states: { dormant: { on: { 'MODAL_TOGGLE_INTERACTIVE_STATE': 'active' } }, active: { on: { 'MODAL_TOGGLE_INTERACTIVE_STATE': 'dormant' } }, } }, { actions: {} });