sidebar |
---|
auto |
- (default) 注入store
import spring from 'redux-spring'
const store = createStore();
spring(store);
- example
@service('namespace')
class ModelA extends Model {
@inject(UserModel) user;
}
- 类型:
Function
- 参数: 'ns' 模块名字空间
@service('namespace')
class ModelA {
}
- 主要用来给模块实例/模块提供api, 定义模块的时候继承此接口
- ns 模块名字空间, 定义在类上
- 类型:
string
- 类型:
- setData 类实例方法,批量给实例属性设置新值
- 类型:
Function
- 类型:
- reset 类实例方法,重置模块中数据到初始值
- 类型:
Function
- 类型:
- 类型:
Function
- 参数: Class 需要注入实例的模块类
- 类型:
string
- 参数: 需要注入实例的模块名
-
类型:
Function
-
参数: Model 模块类名
-
返回: 模块实例
react-hooks 获取模块实例
-
类型:
Function
-
参数: Generator实例
-
返回: Promise对象
转换Generator类型到Promise类型