Skip to content

Commit

Permalink
docs(useLockFn): extends any is unnecessary (alibaba#2423)
Browse files Browse the repository at this point in the history
* style(useLockFn): extends any is unnecessary

* docs(useLockFn): extends any is unnecessary
  • Loading branch information
coding-ice authored and Wait committed Feb 26, 2024
1 parent 8023c3d commit 23006e1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/hooks/src/useLockFn/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Add lock to an async function to prevent parallel executions.
## API

```typescript
function useLockFn<P extends any[] = any[], V extends any = any>(
function useLockFn<P extends any[] = any[], V = any>(
fn: (...args: P) => Promise<V>
): fn: (...args: P) => Promise<V | undefined>;
```
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/useLockFn/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useRef, useCallback } from 'react';

function useLockFn<P extends any[] = any[], V extends any = any>(fn: (...args: P) => Promise<V>) {
function useLockFn<P extends any[] = any[], V = any>(fn: (...args: P) => Promise<V>) {
const lockRef = useRef(false);

return useCallback(
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/useLockFn/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ nav:
## API

```typescript
function useLockFn<P extends any[] = any[], V extends any = any>(
function useLockFn<P extends any[] = any[], V = any>(
fn: (...args: P) => Promise<V>
): fn: (...args: P) => Promise<V | undefined>;
```
Expand Down

0 comments on commit 23006e1

Please sign in to comment.