Robot

一个函数式、不可变的有限状态机库。『🤖 A functional, immutable Finite State Machine library』

Github星跟蹤圖

Robot

A small functional and immutable Finite State Machine library. Using state machines for your components brings the declarative programming approach to application state.

See thisrobot.life for the main documentation.

import { createMachine, interpret, state, transition } from 'robot3';

let machine = createMachine({
  off: state(
    transition('toggle', 'on')
  ),
  on: state(
    transition('toggle', 'off')
  )
});

const service = interpret(machine, () => {
  render();
});

📚 Documentation

Testing

Tests are located in the test/ folder. Load test/test.html in your browser of choice with any HTTP server you like (I use http-server). Tests are written in QUnit and are simple to understand.

Integrations

Robot works with a variety of UI libraries, and includes integrations for React, Preact, Haunted, and more. See the integrations page to learn more.

License

BSD-2-Clause

主要指標

概覽
名稱與所有者matthewp/robot
主編程語言JavaScript
編程語言JavaScript (語言數: 3)
平台
許可證BSD 2-Clause "Simplified" License
所有者活动
創建於2019-09-09 11:44:29
推送於2025-10-07 19:43:57
最后一次提交
發布數50
最新版本名稱robot-docs@0.0.1 (發布於 2025-09-20 19:29:35)
第一版名稱v0.2.0 (發布於 2019-09-18 08:13:22)
用户参与
星數2.1k
關注者數18
派生數92
提交數367
已啟用問題?
問題數108
打開的問題數16
拉請求數125
打開的拉請求數2
關閉的拉請求數17
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?