import { useCallback, useMemo, useState } from "preact/hooks";

export const useUpdate = (): [unknown, () => void] => {
    const [value, setValue] = useState(0);

    const update = useCallback(() => setValue(v => v + 1), [setValue]);

    return useMemo(() => [value, update], [value, update]);
};
