vue-request
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -5,3 +5,3 @@ # Changelog | ||
### [1.0.4](https://github.com/attojs/vue-request/compare/v1.0.3...v1.0.4) (2021-03-08) | ||
### [1.0.5](https://github.com/attojs/vue-request/compare/v1.0.4...v1.0.5) (2021-03-22) | ||
@@ -11,4 +11,12 @@ | ||
* `useLoadMore` types ([0e673bf](https://github.com/attojs/vue-request/commit/0e673bffb683164bfad6c58b4aa58c7d7734428e)) | ||
* `onSuccess` of `BaseOptions` must be optional ([4133481](https://github.com/attojs/vue-request/commit/413348141837bbffba5ad9872cd839bb1d555665)) | ||
* `onSuccess` type is incorrect ([407ed11](https://github.com/attojs/vue-request/commit/407ed116ebed813e1f07cede97ad2285281e76ba)), closes [#31](https://github.com/attojs/vue-request/issues/31) | ||
* invalid import path ([0a31504](https://github.com/attojs/vue-request/commit/0a315040a1e38cbb9b8cb877b912fbde091f471c)), closes [#33](https://github.com/attojs/vue-request/issues/33) | ||
### [1.0.4](https://github.com/attojs/vue-request/compare/v1.0.3...v1.0.4) (2021-03-08) | ||
### Bug Fixes | ||
- fix `useLoadMore` types ([0e673bf](https://github.com/attojs/vue-request/commit/0e673bffb683164bfad6c58b4aa58c7d7734428e)) | ||
### [1.0.3](https://github.com/attojs/vue-request/compare/v1.0.0-beta.11...v1.0.3) (2021-03-06) | ||
@@ -15,0 +23,0 @@ |
@@ -5,3 +5,3 @@ # Changelog | ||
### [1.0.4](https://github.com/attojs/vue-request/compare/v1.0.3...v1.0.4) (2021-03-08) | ||
### [1.0.5](https://github.com/attojs/vue-request/compare/v1.0.4...v1.0.5) (2021-03-22) | ||
@@ -11,4 +11,12 @@ | ||
* `useLoadMore` types ([0e673bf](https://github.com/attojs/vue-request/commit/0e673bffb683164bfad6c58b4aa58c7d7734428e)) | ||
* `onSuccess` of `BaseOptions` must be optional ([4133481](https://github.com/attojs/vue-request/commit/413348141837bbffba5ad9872cd839bb1d555665)) | ||
* `onSuccess` type is incorrect ([407ed11](https://github.com/attojs/vue-request/commit/407ed116ebed813e1f07cede97ad2285281e76ba)), closes [#31](https://github.com/attojs/vue-request/issues/31) | ||
* invalid import path ([0a31504](https://github.com/attojs/vue-request/commit/0a315040a1e38cbb9b8cb877b912fbde091f471c)), closes [#33](https://github.com/attojs/vue-request/issues/33) | ||
### [1.0.4](https://github.com/attojs/vue-request/compare/v1.0.3...v1.0.4) (2021-03-08) | ||
### Bug Fixes | ||
- 修复 `useLoadMore` 类型 ([0e673bf](https://github.com/attojs/vue-request/commit/0e673bffb683164bfad6c58b4aa58c7d7734428e)) | ||
### [1.0.3](https://github.com/attojs/vue-request/compare/v1.0.0-beta.11...v1.0.3) (2021-03-06) | ||
@@ -15,0 +23,0 @@ |
@@ -1,3 +0,3 @@ | ||
import { LoadMoreExtendsOption } from 'src/useLoadMore'; | ||
import { PaginationExtendsOption } from 'src/usePagination'; | ||
import { LoadMoreExtendsOption } from '../useLoadMore'; | ||
import { PaginationExtendsOption } from '../usePagination'; | ||
import { InjectionKey, Ref, WatchSource } from 'vue'; | ||
@@ -34,5 +34,8 @@ import { State } from './createQuery'; | ||
}; | ||
declare const FRPlaceholderType: unique symbol; | ||
export declare type FRPlaceholderType = typeof FRPlaceholderType; | ||
export declare type FormatOptions<R, P extends unknown[], FR> = { | ||
formatResult: (data: R) => FR; | ||
} & BaseOptions<FR, P>; | ||
onSuccess?: (data: FR extends FRPlaceholderType ? any : FR, params: P) => void; | ||
} & Omit<BaseOptions<FR, P>, 'onSuccess'>; | ||
export declare type MixinOptions<R, P extends unknown[], FR> = BaseOptions<R, P> | FormatOptions<R, P, FR>; | ||
@@ -45,1 +48,2 @@ export declare type Config<R, P extends unknown[]> = Omit<BaseOptions<R, P>, 'defaultParams' | 'manual' | 'ready' | 'refreshDeps' | 'queryKey'> & Required<Pick<BaseOptions<R, P>, 'loadingDelay' | 'pollingWhenHidden' | 'pollingWhenOffline' | 'refreshOnWindowFocus' | 'errorRetryCount' | 'errorRetryInterval'>> & { | ||
}; | ||
export {}; |
import { Ref } from 'vue'; | ||
import { BaseOptions, FormatOptions } from './core/config'; | ||
import { BaseOptions, FormatOptions, FRPlaceholderType } from './core/config'; | ||
import { BaseResult } from './core/useAsyncQuery'; | ||
@@ -29,4 +29,4 @@ import { ServiceParams } from './core/utils/types'; | ||
declare function useLoadMore<R, P extends unknown[] = any, LR extends unknown[] = any[]>(service: LoadMoreService<R, P, LR>): LoadMoreResult<R, P, LR>; | ||
declare function useLoadMore<R, P extends unknown[] = any, FR = any, LR extends unknown[] = any[]>(service: LoadMoreService<R, P, LR>, options: LoadMoreFormatOptions<R, P, FR>): LoadMoreResult<FR, P, LR>; | ||
declare function useLoadMore<R, P extends unknown[] = any, FR = FRPlaceholderType, LR extends unknown[] = any[]>(service: LoadMoreService<R, P, LR>, options: LoadMoreFormatOptions<R, P, FR>): LoadMoreResult<FR, P, LR>; | ||
declare function useLoadMore<R, P extends unknown[] = any, LR extends unknown[] = any[]>(service: LoadMoreService<R, P, LR>, options: LoadMoreBaseOptions<R, P>): LoadMoreResult<R, P, LR>; | ||
export default useLoadMore; |
import { Ref } from 'vue'; | ||
import { BaseOptions, FormatOptions } from './core/config'; | ||
import { BaseOptions, FormatOptions, FRPlaceholderType } from './core/config'; | ||
import { BaseResult } from './core/useAsyncQuery'; | ||
@@ -28,4 +28,4 @@ import { IService } from './core/utils/types'; | ||
declare function usePagination<R, P extends unknown[] = any>(service: IService<R, P>): PaginationResult<R, P>; | ||
declare function usePagination<R, P extends unknown[] = any, FR = any>(service: IService<R, P>, options: PaginationFormatOptions<R, P, FR>): PaginationResult<FR, P>; | ||
declare function usePagination<R, P extends unknown[] = any, FR = FRPlaceholderType>(service: IService<R, P>, options: PaginationFormatOptions<R, P, FR>): PaginationResult<FR, P>; | ||
declare function usePagination<R, P extends unknown[] = any>(service: IService<R, P>, options: PaginationBaseOptions<R, P>): PaginationResult<R, P>; | ||
export default usePagination; |
@@ -1,2 +0,2 @@ | ||
import { BaseOptions, FormatOptions } from './core/config'; | ||
import { BaseOptions, FormatOptions, FRPlaceholderType } from './core/config'; | ||
import { BaseResult } from './core/useAsyncQuery'; | ||
@@ -8,4 +8,4 @@ import { IService } from './core/utils/types'; | ||
declare function useRequest<R, P extends unknown[] = any>(service: IService<R, P>): RequestResult<R, P>; | ||
declare function useRequest<R, P extends unknown[] = any, FR = any>(service: IService<R, P>, options: FormatOptions<R, P, FR>): RequestResult<FR, P>; | ||
declare function useRequest<R, P extends unknown[] = any, FR = FRPlaceholderType>(service: IService<R, P>, options: FormatOptions<R, P, FR>): RequestResult<FR, P>; | ||
declare function useRequest<R, P extends unknown[] = any>(service: IService<R, P>, options: BaseOptions<R, P>): RequestResult<R, P>; | ||
export default useRequest; |
{ | ||
"name": "vue-request", | ||
"version": "1.0.4", | ||
"description": "A request library for Vue 3", | ||
"version": "1.0.5", | ||
"description": "Vue 3 composition API for data fetching, supports SWR, polling, error retry, cache request, pagination and other cool features.", | ||
"license": "MIT", | ||
@@ -22,2 +22,4 @@ "keywords": [ | ||
}, | ||
"bugs": "https://github.com/attojs/vue-request/issues", | ||
"homepage": "https://www.attojs.org", | ||
"main": "dist/index.cjs.js", | ||
@@ -24,0 +26,0 @@ "module": "dist/index.es.js", |
[English](./README.md) | 简体中文 | ||
<p align="center"> | ||
<img | ||
width="150" | ||
src="https://raw.githubusercontent.com/AttoJS/art/master/vue-request-logo.png" | ||
alt="VueRequest logo" | ||
/> | ||
<a href="https://www.attojs.com"> | ||
<img | ||
width="150" | ||
src="https://raw.githubusercontent.com/AttoJS/art/master/vue-request-logo.png" | ||
alt="VueRequest logo" | ||
/> | ||
</a> | ||
</p> | ||
<h1 align="center">VueRequest</h1> | ||
<div align="center"> | ||
<p align="center">⚡️ 一个很酷的 Vue3 的请求库</p> | ||
<p align="center">⚡️ 一个能轻松帮你管理请求状态(支持SWR,轮询,错误重试,缓存,分页等)的 Vue 3 composition API 请求库</p> | ||
<a href="https://codecov.io/github/attojs/vue-request?branch=master"> | ||
@@ -49,5 +51,5 @@ <img | ||
- [English](https://attojs.github.io/vue-request-docs/) | ||
- [中文](https://attojs.github.io/vue-request-docs/zh/) | ||
- [国内镜像](https://attojs.gitee.io/vue-request-docs/zh/) | ||
- [English](https://www.attojs.org/) | ||
- [中文](https://www.attojs.org/zh/) | ||
- [国内镜像](https://www.attojs.com/zh/) | ||
@@ -54,0 +56,0 @@ ## 安装 |
English | [简体中文](README-zh_CN.md) | ||
<p align="center"> | ||
<img | ||
width="150" | ||
src="https://raw.githubusercontent.com/AttoJS/art/master/vue-request-logo.png" | ||
alt="VueRequest logo" | ||
/> | ||
<a href="https://www.attojs.org"> | ||
<img | ||
width="150" | ||
src="https://raw.githubusercontent.com/AttoJS/art/master/vue-request-logo.png" | ||
alt="VueRequest logo" | ||
/> | ||
</a> | ||
</p> | ||
<h1 align="center">VueRequest</h1> | ||
<div align="center"> | ||
<p align="center">⚡️ A request library for Vue 3.</p> | ||
<p align="center">⚡️ Vue 3 composition API for data fetching, supports SWR, polling, error retry, cache request, pagination, etc.</p> | ||
<a href="https://codecov.io/github/attojs/vue-request?branch=master"> | ||
@@ -49,5 +51,5 @@ <img | ||
- [English](https://attojs.github.io/vue-request-docs/) | ||
- [中文](https://attojs.github.io/vue-request-docs/zh/) | ||
- [国内镜像](https://attojs.gitee.io/vue-request-docs/zh/) | ||
- [English](https://www.attojs.org/) | ||
- [中文](https://www.attojs.org/zh/) | ||
- [国内镜像](https://www.attojs.com/zh/) | ||
@@ -54,0 +56,0 @@ ## Install |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
625046
14782
0
103