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

[Feature Request]在传入initialData时去除data中的undefined类型 #195

Closed
yangmiao7 opened this issue Apr 3, 2023 · 2 comments
Closed

Comments

@yangmiao7
Copy link

需求描述 Feature Description

目前useRequest方法调用时,即使传入了initialData,data的返回值中还是会| undefined,导致实际使用接口数据的时候,需要加入非空校验;

declare type State<R, P> = {
    loading: Ref<boolean>;
    data: Ref<R | undefined>;
    error: Ref<Error | undefined>;
    params: Ref<P>;
};

建议的解决方案 Proposed Solution

期望在传入initialData data的类型去掉undefined,或者使用initalData的类型替代undefined

其他信息 Other information

#165

@yangmiao7 yangmiao7 changed the title [Feature Request] [Feature Request]在传入initialData时去除data中的undefined类型 Apr 3, 2023
@Tanimodori
Copy link

Duplicate of #165

@John60676
Copy link
Member

Duplicate of #165

@John60676 John60676 marked this as a duplicate of #165 Apr 6, 2023
@John60676 John60676 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants