mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
chore(core-blocks): CB-1825 make onUpdate callback in useUserData optional
This commit is contained in:
@@ -14,7 +14,7 @@ import { useService } from '@cloudbeaver/core-di';
|
||||
export function useUserData<T>(
|
||||
key: string,
|
||||
defaultValue: () => T,
|
||||
onUpdate: (data: T) => void,
|
||||
onUpdate?: (data: T) => void,
|
||||
validate?: (data: T) => boolean
|
||||
): T {
|
||||
const userDataService = useService(UserDataService);
|
||||
@@ -25,7 +25,7 @@ export function useUserData<T>(
|
||||
|
||||
useEffect(() => {
|
||||
if (previous !== data) {
|
||||
onUpdate(data);
|
||||
onUpdate?.(data);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user