MCPcopy Create free account
hub / github.com/react-hook-form/react-hook-form / sleep

Function sleep

app/src/defaultValuesAsync.tsx:4–5  ·  view source on GitHub ↗
(data: T, ms: number)

Source from the content-addressed store, hash-verified

2import { useForm } from 'react-hook-form';
3
4const sleep = <T,>(data: T, ms: number) =>
5 new Promise<T>((res) => setTimeout(() => res(data), ms));
6
7function DefaultValues() {
8 const { register } = useForm({

Callers 5

DefaultValuesFunction · 0.70
AppFunction · 0.50
LoaderFunction · 0.50
resolverFunction · 0.50
AppFunction · 0.50

Calls

no outgoing calls

Tested by 4

AppFunction · 0.40
LoaderFunction · 0.40
resolverFunction · 0.40
AppFunction · 0.40