Closed alvinhui closed 4 years ago
Merging #104 into release/1.4.0 will decrease coverage by
3.95%
. The diff coverage is39.13%
.
@@ Coverage Diff @@
## release/1.4.0 #104 +/- ##
=================================================
- Coverage 87.91% 83.95% -3.96%
=================================================
Files 20 19 -1
Lines 546 561 +15
Branches 121 121
=================================================
- Hits 480 471 -9
- Misses 56 80 +24
Partials 10 10
Impacted Files | Coverage Δ | |
---|---|---|
src/plugins/error.tsx | 88.88% <ø> (+6.94%) |
:arrow_up: |
src/plugins/loading.tsx | 88.33% <ø> (+7.17%) |
:arrow_up: |
src/index.tsx | 83.33% <10.00%> (ø) |
|
src/plugins/modelApis.tsx | 60.00% <44.06%> (-23.73%) |
:arrow_down: |
针对目前 API 太多且有些不一致的问题,其实目前内部的实现可以允许这样使用 createStore 方法:
import { createStore, withModel } from '@ice/store';
// 使用 createStore
const { Provider, getModelAPIs } = createStore({ model });
const { useValue, withValue, useState, getValue, getState } = getModelAPIs('model');
function Component() {
const [ state ] = useValue();
}
// 使用 withModel
function Component({ model }) {
const [ state ] = model.useValue();
}
withModel(model)(Component);
API 收敛的问题要在这个 MR 处理吗,还是另外在发版本支持?
API 收敛的问题要在这个 MR 处理吗,还是另外在发版本支持?
建议不在这个 MR 上处理,未来再发版本支持。两个步骤:
与 @alvinhui 讨论目前遗留两个问题另外新建 issue 处理:
需求背景
https://github.com/ice-lab/icejs/issues/244
API
模型定义
模型消费
参考 ModelAPIs 的定义 获取所有对外的 API。
说明
该 PR 中包含示例及文档的更新。