UNPKG

@spotinst/spinnaker-deck

Version:

Spinnaker-Deck service, forked with support to Spotinst

12 lines (9 loc) 218 B
import React from 'react'; const { useEffect, useRef } = React; export const usePrevious = <T>(value: T): T => { const ref = useRef<T>(); useEffect(() => { ref.current = value; }); return ref.current; };