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

feat(actions): useRequest options add fetchKey #73

Closed
dompling opened this issue Apr 28, 2024 · 6 comments
Closed

feat(actions): useRequest options add fetchKey #73

dompling opened this issue Apr 28, 2024 · 6 comments
Labels
enhancement New feature or request need reproduce not provide code split or repo

Comments

@dompling
Copy link

dompling commented Apr 28, 2024

Description

列表中多个元素调用同一个接口 loading 和 data 的状态维护

Solution

类似 ahooks 的 fetchKey,可以实现列表中维护不同元素的 loading

@dompling dompling added the enhancement New feature or request label Apr 28, 2024
Copy link

welcome discuss in wechat:

@github-actions github-actions bot added the need reproduce not provide code split or repo label Apr 28, 2024
@dompling dompling changed the title feat(actions): useRequest add fetchKeys feat(actions): useRequest options add fetchKeys Apr 28, 2024
@dompling dompling changed the title feat(actions): useRequest options add fetchKeys feat(actions): useRequest options add fetchKeys Apr 28, 2024
@dompling dompling changed the title feat(actions): useRequest options add fetchKeys feat(actions): useRequest options add fetchKey Apr 28, 2024
@innocces
Copy link
Owner

你说的功能是 2x 的一个配置。新的版本是 3x 的

@innocces
Copy link
Owner

新的版本感觉可以用 cacheKey 来模拟一下那个行为。因为不同的 cacheKey 使用的 service 是独立的

@dompling
Copy link
Author

cacheKey

感谢回复!
请问一下 3.x 版本没有发布吗?

@innocces
Copy link
Owner

cacheKey

感谢回复! 请问一下 3.x 版本没有发布吗?

不是的。

  1. taro-hooks@1.x 里的 useRequest 对标的是 ahooks@2.x 的. 有 fetchKey
  2. taro-hooks@2.x 里的 useRequest 对标的是 ahooks@3.x 的. 无 fetchKey. 有 cacheKey

@dompling
Copy link
Author

2. cacheKey

好的,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request need reproduce not provide code split or repo
Projects
None yet
Development

No branches or pull requests

2 participants