white-bull
React Component 与 data 的连接器。
use
Component { //say 自动绑定到props上 let say = thisprops; return <div>saytext</div> } // extends Module { supernamespace thisstate = text:"hello world" } //把 HelloModule 中的 state 绑定到 Hello 的 props.say 中let App = ; ;
API
- Module
继承 Module
可指定默认 state
, 添加其他操作state的方法
{ supernamespace //default props thisstate = } //.... { //update state this }
- connection
链接组件与Module
, module需要指定命名空间,命名空间作为props
的属性,和dispatch
的参数前缀
Component { // this.props.hello }
- dispatch
触发动作
//这里触发了相当于调用了 new HelloModule("hello") 这个实例的 .update(arg1, arg2)方法 ;