lndsld

Home > @lndsld/react-hooks > useChange

useChange() function

Subscribe to value changes (like componentDidUpdate from class components)

Signature:

declare function useChange<T>(observer: ChangeCallback<T>, observable: T): void;

Parameters

Parameter Type Description
observer ChangeCallback<T> callback, that should be invoked on value change
observable T value, which changes should be observed by hook

Returns:

void