statebot
    Preparing search index...

    Function decomposeChart

    • Decompose a TStatebotChart into an object of states, routes, and transitions.

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

      Parameters

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

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