hunk.code_window:         }
         }
       };
       const service = interpret(Machine(invalidMachine));
       assert.throws(
         () => service.start(),
         `Initial state 'create' not found on 'fetchMachine'`
       );
     });
     it('should not update when stopped', () => {
       let state = lightMachine.initialState;
  
hunk.labels: keep keep keep keep replace replace replace replace replace keep keep keep keep
hunk.after_edit:     assert.throws(() => {
         interpret(Machine(invalidMachine)).start();
       }, `Initial state 'create' not found on 'fetchMachine'`);
  
hunk.file_path: test/interpreter.test.ts
hunk.type: replace
file: import { EventObject, SingleOrArray, ActionObject } from '.';
  
  export function each<TContext, TEvent extends EventObject>(
    collection: keyof TContext,
    item: keyof TContext,
    actions: SingleOrArray<ActionObject<TContext, TEvent>>
  ): ActionObject<TContext, TEvent>;
  export function each<TContext, TEvent extends EventObject>(
    collection: keyof TContext,
    item: keyof TContext,
    index: keyof TContext,
    actions: SingleOrArray<ActionObject<TContext, TEvent>>
  ): ActionObject<TContext, TEvent>;
  export function each<TContext, TEvent extends EventObject>(
    collection: keyof TContext,
    item: keyof TContext,
    indexOrActions:
      | keyof TContext
      | SingleOrArray<ActionObject<TContext, TEvent>>,
    maybeActions?: SingleOrArray<ActionObject<TContext, TEvent>>
  ): ActionObject<TContext, TEvent> {
    const actions = maybeActions || indexOrActions;
    const index = maybeActions ? indexOrActions : undefined;
  
    return {
      type: 'xstate.foreach',
      collection,
      item,
      index,
      actions
    };
  }
  