Function decomposeChart

  • decomposeChart(chart: TStatebotChart): { routes: string[]; states: string[]; transitions: string[][] }
  • Decompose a TStatebotChart into an object of states, routes, and transitions.

    Statebot() uses this internally to parse charts. Exposed for debugging.

    Returns

    Example

    let { states, routes, transitions } = decomposeChart`
    pending ->
    success | failure
    `
    // states = ['pending', 'success', 'failure']
    // routes = [ 'pending->success', 'pending->failure']
    // transitions = [
    // ['pending', 'success'],
    // ['pending', 'failure']
    // ]

    Parameters

    Returns { routes: string[]; states: string[]; transitions: string[][] }

    • routes: string[]
    • states: string[]
    • transitions: string[][]

Generated using TypeDoc