deno.land / x / xstate@xstate@4.33.6 / test / fixtures / omni.ts
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106import { Machine } from '../../src';
const omniMachine = Machine({ id: 'omni', initial: 'compound', context: { count: 0 }, states: { compound: { type: 'compound', initial: 'deep', states: { deep: { type: 'compound', initial: 'first', states: { first: { type: 'compound', initial: 'one', states: { one: {}, two: {}, three: { type: 'final' } } }, second: { type: 'final' }, shallowHist: { type: 'history', history: 'shallow' }, deepHist: { type: 'history', history: 'deep' } } } } }, parallel: { type: 'parallel', states: { left: { type: 'compound', states: { one: {}, two: {}, three: { type: 'final' } } }, middle: { type: 'compound', states: { one: { after: { 1000: 'two' } }, two: { after: { 2000: [ { target: 'three', cond: (ctx) => ctx.count === 3 }, { target: 'four', cond: (ctx) => ctx.count === 4 }, { target: 'one' } ] } }, three: { after: { 1000: [{ target: 'one', cond: (ctx) => ctx.count === -1 }], 2000: 'four' } }, four: { type: 'final' } } }, right: { type: 'compound', states: { transient: { always: 'one' }, transientCond: { always: [ { target: 'two', cond: (ctx) => ctx.count === 2 }, { target: 'three', cond: (ctx) => ctx.count === 3 }, { target: 'one' } ] }, one: {}, two: {}, three: {}, four: { type: 'final' } } } } } }});
export { omniMachine };
Version Info