hunk.code_window:   const resolvedDevTools = getLazy(devTools);
     const inspectMachine = createInspectMachine(resolvedDevTools);
     const inspectService = interpret(inspectMachine).start();
     const listeners = new Set<Observer<any>>();
     let targetWindow: Window | null | undefined;
     let client: any;
     const messageHandler = (event) => {
       if (
  
hunk.labels: keep keep keep add keep keep keep keep keep
hunk.after_edit:   const sub = inspectService.subscribe((state) => {
       listeners.forEach((listener) => listener.next(state));
     });
  
hunk.file_path: packages/xstate-inspect/src/browser.ts
hunk.type: add
file: # Installation
  
  You can install XState from NPM or Yarn, or you can embed the `<script>` directly from a CDN.
  
  ## Package Manager
  
  ```bash
  npm install xstate@latest --save
  # or:
  yarn add xstate@latest --save
  ```
  
  ## Exports
  
  The important exports are as follows:
  
  ```js {2-9}
  import {
    Machine,
    State,
    actions,
    assign,
    send,
    sendParent,
    interpret,
    spawn
  } from 'xstate';
  ```
  
  ## CDN
  
  You can include XState directly from the [unpkg CDN](https://unpkg.com/xstate@4/dist/):
  
  - XState core: [https://unpkg.com/xstate@4/dist/xstate.js](https://unpkg.com/xstate@4/dist/xstate.js)
  - XState web: [https://unpkg.com/xstate@4/dist/xstate.web.js](https://unpkg.com/xstate@4/dist/xstate.web.js)
    - Browser-friendly, ES module build
  
  ```html
  <script src="https://unpkg.com/xstate@4/dist/xstate.js"></script>
  ```
  
  The variable `XState` will be available globally, which will give you access to the top-level exports.
  
  ```js
  const { Machine, actions, interpret } = XState; // global variable: window.XState
  
  const lightMachine = Machine({
    // ...
  });
  
  const lightService = interpret(lightMachine);
  ```
  