Hosted onsgr-archive.hyper.mediavia theHypermedia Protocol

Integration: Vanilla JS

Integration: Vanilla JS

Use XState state machines without a framework — pure JavaScript for any environment.

Overview

XState works anywhere JavaScript runs. This guide covers using machines in vanilla JS contexts: plain HTML pages, Web Components, Node.js, or any non-framework environment.

Key Concepts


    createMachine and interpret

    Manual subscription to state changes

    DOM event bindings

    Actor lifecycle management

Prerequisites

Related Pages


TODO


    Add Web Component examples

    Add service worker machine patterns

    Add Node.js backend examples

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime