Skip to content

Commit

Permalink
Merge pull request alibaba#1011 from maoxiaoke/types/request_service
Browse files Browse the repository at this point in the history
types/request service
  • Loading branch information
brickspert authored Jul 7, 2021
2 parents 00696db + b476e49 commit 27d7588
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/use-request/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ export type Service<R, P extends any[]> = (...args: P) => Promise<R>;
export type Subscribe<R, P extends any[]> = (data: FetchResult<R, P>) => void;
export type Mutate<R> = (x: R | undefined | ((data: R) => R)) => void;

export type RequestService = string | { [key: string]: any };
export interface RequestServiceObject extends RequestInit {
readonly url: string;
[key: string]: any; // backward compatibility
}
export type RequestService = string | RequestServiceObject;
export type CombineService<R, P extends any[]> =
| RequestService
| ((...args: P) => RequestService)
Expand Down

0 comments on commit 27d7588

Please sign in to comment.