Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pallyoung/react-mlux-binder
https://github.com/pallyoung/react-mlux-binder
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/pallyoung/react-mlux-binder
- Owner: pallyoung
- Created: 2016-12-06T09:59:37.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-21T06:36:34.000Z (over 7 years ago)
- Last Synced: 2024-11-06T08:22:43.674Z (2 months ago)
- Language: JavaScript
- Size: 229 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-mlux-binder
基于[mlux](https://github.com/pallyoung/mlux),用于实现在react或者react-native框架下组件自动监听store变化并更新。
* [features](#features)
* [demo](#demo)
* [usage](#usage)
* [API Reference](#api-reference)## Features
* 在监听的store数据发生变化时动态更新视图。
* 提供多种方法方便创建Binder组件。## Demo
请移步[Lottery](https://github.com/pallyoung/lottery)项目;
## Usage
在项目根目录下执行
```
npm install react-mlux-binder --save
```
在项目文件中引入
```javascript
import Binder from 'react-mlux-binder';
```
## API Reference* [Binder](#binder)
* [Binder.createClass](#bindercreateclass)```javascript
//当testStore的值发生改变的时,Text组件中的内容将会自动更新。
{testStore.value}}}/>
```#### Binder.createClass
createClass方法将一个普通的Component变成一个Binder Component。
```javascript
Binder.createClass(ReactComponent:Class>):Class<*>
``````javascript
let BinderA = Binder.createClass(A);{
name:store.name
}} />
```