Robot

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

  • 所有者: matthewp/robot
  • 平台: Web browsers,Linux,Mac,Windows
  • 許可證: BSD 2-Clause "Simplified" License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

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-02-05 13:23:20
最后一次提交
發布數48
最新版本名稱robot3@1.1.1 (發布於 2025-02-05 13:23:19)
第一版名稱v0.2.0 (發布於 2019-09-18 08:13:22)
用户参与
星數2k
關注者數18
派生數91
提交數361
已啟用問題?
問題數103
打開的問題數12
拉請求數119
打開的拉請求數3
關閉的拉請求數16
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?