Category | State |
---|---|
Export Size | 143 B |
Last Changed | last year |
Records the timestamp of the last change
import { useLastChanged } from '@vueuse/core' const a = ref(0) const lastChanged = useLastChanged(a) a.value = 1 console.log(lastChanged.value)
export interface UseLastChangedOptions< Immediate extends boolean, InitialValue extends number | null | undefined = undefined > extends WatchOptions<Immediate> { initialValue?: InitialValue } /** * Records the timestamp of the last change * * @see https://vueuse.org/useLastChanged */ export declare function useLastChanged( source: WatchSource, options?: UseLastChangedOptions<false> ): Ref<number | null> export declare function useLastChanged( source: WatchSource, options: UseLastChangedOptions<true> ): Ref<number> export declare function useLastChanged( source: WatchSource, options: UseLastChangedOptions<boolean, number> ): Ref<number>
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/shared/useLastChanged/