use-url-sync
Version:
use-url-sync is a utility package that helps you sync your states to url without hassle
12 lines (11 loc) • 441 B
TypeScript
interface IUseUrlSyncProps<S> {
states: S;
ignore?: {
[P in keyof S]?: boolean | ((value: S[P]) => boolean);
};
onStatesUpdated?: {
[P in keyof S]?: (value: S[P]) => S[P];
};
}
declare const useUrlSync: <S extends Record<string | number, string | number>>({ states, ignore, onStatesUpdated }: IUseUrlSyncProps<S>, onUrlGenerated: (nextPath: string) => void) => void;
export default useUrlSync;