import { useEffect, useRef } from 'react'

export const useUpdateEffect = (fn: () => void, inputs: unknown[]) => {
  const mountRef = useRef(false)

  useEffect(() => {
    if (mountRef.current) {
      return fn()
    }
    mountRef.current = true
  }, inputs)
}
