import React, { DependencyList, EffectCallback, useEffect, useRef, useState } from 'react';

export function useDidUpdateEffect(effect: EffectCallback, deps?: DependencyList): any {
   const didMountRef = useRef(false);

   useEffect(() => {
      if (didMountRef.current) effect();
      else didMountRef.current = true;
   }, deps);
}
