Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: ModelEffects 或 createModel 类型定义错误 #154

Open
LongchongWang opened this issue May 23, 2023 · 3 comments
Open

Bug: ModelEffects 或 createModel 类型定义错误 #154

LongchongWang opened this issue May 23, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@LongchongWang
Copy link

@ice/store version: 2.0.3

Steps To Reproduce

  1. 下载 @ice/store 源码
  2. 进入 example/todos 文件夹
  3. npm i
  4. 修改 src/models/todos.ts 文件的 effects,查看第二个参数的类型

通读了 docs 文件夹下的所有文档,没有找到解决办法。我个人定位的原因是 ModelEffects 类型定义错误导致。

Link to code example:

The current behavior

image
image

The expected behavior

定义effects时能正确解析出第二个参数的类型

@LongchongWang LongchongWang added the bug Something isn't working label May 23, 2023
@hzyhbk
Copy link
Contributor

hzyhbk commented Jul 31, 2023

@LongchongWang 试试这个解法呢 #143

@asins
Copy link

asins commented Aug 18, 2023

我遇到了一样的问题,太诧异了,看recipes.md中的描述rootState指的是所有注册的model,而且已经配置好。
image

但TS提示的却只是当前model本身,我在使用时只能自己强制指定类型了:
image

@Cacivy
Copy link

Cacivy commented Dec 7, 2023

@LongchongWang 试试这个解法呢 #143

一样的问题,增加类型定义后dispatch类型正常,rootState还是不对

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants