Skip to content

Commit 16bf793

Browse files
committed
docs: opt
1 parent 8a864a3 commit 16bf793

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

docs/en/components/useRequest.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ All features, options, and return values of the `useRequest` component are consi
5555
- When you want to leverage slots for flexible UI customization
5656
- When you need to keep logic and UI closely coupled in your component templates
5757

58-
5958
## Using `createUseRequestComponent`
6059

6160
In addition to the built-in `<use-request />` component, you can use the `createUseRequestComponent` utility to generate your own request components with custom types or behaviors.
@@ -99,4 +98,4 @@ The API, props, and slot props of the component created by `createUseRequestComp
9998

10099
- When you need a request component with specific data types.
101100
- When you want to encapsulate default options or logic for a certain business scenario.
102-
- When you want to improve type inference and code completion in your project.
101+
- When you want to improve type inference and code completion in your project.

packages/hooks/src/useRequest/component-use/UseRequest.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ import type {
77
} from "../types";
88
import { isEqual } from "lodash-es";
99

10+
// type UnwrapRefProps<T> = {
11+
// [K in keyof T]: T[K] extends (...args: any[]) => any
12+
// ? T[K]
13+
// : T[K] extends Readonly<Ref<infer V>>
14+
// ? V
15+
// : T[K] extends object
16+
// ? UnwrapRefProps<T[K]>
17+
// : T[K]
18+
// }
19+
1020
// 泛型工厂
1121
function createUseRequestComponent<
1222
TServiceData = any,

packages/use-url-state/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import qs from 'qs'
66
import { Ref, ref, watch, watchEffect } from 'vue'
77
import useLocalStorageState from 'vue-hooks-plus/es/useLocalStorageState'
88

9+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
910
const isFunction = (value: unknown): value is Function => typeof value === 'function'
1011

1112
export interface UseUrlStateOptions {
@@ -50,6 +51,7 @@ function decodeParams(valueStr: string, detectNumber: boolean): Record<string, u
5051
// utf-8
5152
try {
5253
return decodeURIComponent(strWithoutPlus)
54+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
5355
} catch (e) {
5456
return strWithoutPlus
5557
}

0 commit comments

Comments
 (0)