Skip to content

请求发起后是否应该返回promis对象? #1

@pastry-2841

Description

@pastry-2841

const [{ data }, fetch] = useRequest(getConfig)
调用fetch后无法获取请求状态,比如是否成功?只能通过data等属性值的变化来推测状态

Modal.confirm({ title: '信息配置', onOk() { return fetch() }, })
上例中,antd提供的对话框中,onOk函数接收一个promis返回值,在接口loading状态时,ok按钮也会处于loading状态,但目前fetch没有返回promis对象导致无法使用这个功能

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions