This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useMemo, useRef } from 'react' | |
import { isEqual } from 'lodash-es' | |
type UseEffectParams = Parameters<typeof useEffect> | |
type EffectCallback = UseEffectParams[0] | |
type DependencyList = UseEffectParams[1] | |
type UseEffectReturn = ReturnType<typeof useEffect> | |
const isPrimitive = (val: unknown) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useCallback } from 'react' | |
import { debounce } from 'lodash-es' | |
import { useWatch } from 'react-hook-form-mui' | |
import type { useForm } from 'react-hook-form-mui' | |
import { useDeepEffect } from '@/hooks/use-deep-effect' | |
const useAutoSave = (context: ReturnType<typeof useForm>, onSubmit: (data: unknown) => void) => { | |
const watch = useWatch({ control: context.control }) |
OlderNewer