{"id":13491206,"url":"https://github.com/bbxjs/bbx","last_synced_at":"2025-05-06T16:38:00.779Z","repository":{"id":57189335,"uuid":"143974851","full_name":"bbxjs/bbx","owner":"bbxjs","description":"𝕓𝕓𝕩 是一个极其简单高效的 React 状态管理方式","archived":false,"fork":false,"pushed_at":"2018-08-23T13:48:12.000Z","size":83,"stargazers_count":131,"open_issues_count":1,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-20T22:33:06.425Z","etag":null,"topics":["react","state"],"latest_commit_sha":null,"homepage":"https://bbxjs.github.io/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbxjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-08T07:10:52.000Z","updated_at":"2024-12-12T05:55:07.000Z","dependencies_parsed_at":"2022-09-15T06:21:43.270Z","dependency_job_id":null,"html_url":"https://github.com/bbxjs/bbx","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbxjs%2Fbbx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbxjs%2Fbbx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbxjs%2Fbbx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbxjs%2Fbbx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbxjs","download_url":"https://codeload.github.com/bbxjs/bbx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252721722,"owners_count":21793878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react","state"],"created_at":"2024-07-31T19:00:54.559Z","updated_at":"2025-05-06T16:38:00.758Z","avatar_url":"https://github.com/bbxjs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","目录"],"sub_categories":[],"readme":"## bbx\n\n[![npm](https://img.shields.io/npm/v/bbx.svg)](https://www.npmjs.com/package/bbx)\n[![travis](https://img.shields.io/travis/bbxjs/bbx.svg)](https://travis-ci.org/bbxjs/bbx)\n[![Coverage Status](https://coveralls.io/repos/github/bbxjs/bbx/badge.svg)](https://coveralls.io/github/bbxjs/bbx)\n![David](https://img.shields.io/david/bbxjs/bbx.svg)\n\n\n\n\n\n𝕓𝕓𝕩 是一个极其简单高效的 React 状态管理方式\n\n开始使用：[https://bbxjs.github.io/start/](https://bbxjs.github.io/start/)\n\n### 特点\n\n- **超简单:baby:**: 了解 api 几乎没成本，会用 React 即会用 bbx，或许你已经会用了\n- **清晰:sun_with_face:**: 状态管理清清楚楚，方法调用也直观明了\n- **扩展性:hatching_chick:**: bbx 内置了许多项目开发中常用的方法，当然你也能很方便的开发更多的方法\n\n\n#### 使用\n\n```\n$ npm install bbx\n```\n\n\n1. 定义一个状态类\n```jsx\nimport { State } from 'bbx';\n\nclass Hello extends State {\n  state = { say: 'hello 👶' }\n  hi() { this.setState({ say: 'hi !' }) }\n}\n```\n\n2. 实例化这个类\n\n```jsx\nconst hello = new Hello();\n```\n\n3. 连接这个实例到 React 组件\n```jsx\nimport { connect } from 'bbx';\n\n@connect(hello)\nclass App extends React.Component {\n  render() {\n    return \u003cdiv\u003e\n      {hello.state.say}\n      \u003cbutton onClick={() =\u003e hello.hi()}\u003ehi\u003c/button\u003e\n    \u003c/div\u003e\n  }\n}\n```\n\n[在线查看可运行的代码](https://stackblitz.com/edit/bbx-example-hello)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbxjs%2Fbbx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbxjs%2Fbbx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbxjs%2Fbbx/lists"}