Skip to content

Commit

Permalink
Update watch.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebill1049 committed Apr 2, 2024
1 parent f4eeaf9 commit 96e4b09
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/content/docs/useform/watch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ This method will watch specified inputs and return their values. It is useful to
This function mainly serves **two purposes**:

1. Returns and keep sync with fields' values
1. <TypeText>`watch(name: string, defaultValue?): unknown`</TypeText>
2. <TypeText>`watch(names: string[], defaultValue?): {[key:string]: unknown}`</TypeText>
3. <TypeText>`watch(): {[key:string]: unknown}`</TypeText>
a. <TypeText>`watch(name: string, defaultValue?): unknown`</TypeText>
b. <TypeText>`watch(names: string[], defaultValue?): {[key:string]: unknown}`</TypeText>
c. <TypeText>`watch(): {[key:string]: unknown}`</TypeText>
2. Start subscribing with given callback function (can be stopped by calling `unsubscribe` function)
1. <TypeText>`watch(callback: (data, { name, type }) => void, defaultValues?): { unsubscribe: () => void }`</TypeText>
a. <TypeText>`watch(callback: (data, { name, type }) => void, defaultValues?): { unsubscribe: () => void }`</TypeText>

The explanation of each of these four overloads follows below.

Expand Down

0 comments on commit 96e4b09

Please sign in to comment.