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?
已存档?
是复刻?
已锁定?
是镜像?
是私有?