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]: useSQRequest.onBeforePushQueue设置为异步回调时无法获取返回数据 #434

Closed
2 tasks done
JOU-amjs opened this issue Jul 2, 2024 · 1 comment
Closed
2 tasks done
Labels
bug:confirmed Something isn't working lang:chinese This issue uses Chinese React Issues or pull request for React

Comments

@JOU-amjs
Copy link
Contributor

JOU-amjs commented Jul 2, 2024

这是否是一个 Bug?

  • 我已经确认我要报告的是一个 Bug

这个问题是否已经存在?

  • 我已经确认这个 Issue 没有被报告过

Alova 版本

3.0.0-beta.9

前端框架

React

问题描述

例如:

useSQRequest(...).onBeforePushQueue(async event => {
      // 每次替换指定id的旧method,减少请求次数
      const prevSumbmitMethod = await getSilentMethod('methodEditNote' + currentId.current, queue);
      if (event.silentMethod && prevSumbmitMethod) {
        await prevSumbmitMethod.replace(event.silentMethod);
        return false;
      }
    })

以上无法阻止SilentMethod进入queue

期望的表现

onBeforePushQueue支持设置异步回调函数

复现链接

No response

复现步骤

系统信息

No response

补充说明

No response

@JOU-amjs JOU-amjs added bug:need-confirm It's probably a bug lang:chinese This issue uses Chinese labels Jul 2, 2024
@JOU-amjs JOU-amjs assigned MeetinaXD and unassigned MeetinaXD Jul 2, 2024
@github-actions github-actions bot added the React Issues or pull request for React label Jul 2, 2024
@JOU-amjs JOU-amjs added bug:confirmed Something isn't working and removed bug:need-confirm It's probably a bug labels Jul 2, 2024
MeetinaXD added a commit that referenced this issue Jul 12, 2024
MeetinaXD added a commit that referenced this issue Jul 12, 2024
fix: cannot stop pushing SilentMethod into queue when using async handler in onBeforePushQueue(#434)
@MeetinaXD
Copy link
Contributor

fixed in #453

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:confirmed Something isn't working lang:chinese This issue uses Chinese React Issues or pull request for React
Projects
None yet
Development

No branches or pull requests

2 participants