pl-hooks: Improve useInstance behavior
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
12eb4d820a
commit
36cc2e103a
1 changed files with 3 additions and 2 deletions
|
@ -5,7 +5,7 @@ import * as v from 'valibot';
|
|||
import { usePlHooksApiClient } from 'pl-hooks/contexts/api-client';
|
||||
import { usePlHooksQueryClient } from 'pl-hooks/contexts/query-client';
|
||||
|
||||
const placeholderData = v.parse(instanceSchema, {});
|
||||
const initialData = v.parse(instanceSchema, {});
|
||||
|
||||
const useInstance = () => {
|
||||
const { client } = usePlHooksApiClient();
|
||||
|
@ -14,7 +14,8 @@ const useInstance = () => {
|
|||
return useQuery({
|
||||
queryKey: ['instance'],
|
||||
queryFn: client.instance.getInstance,
|
||||
placeholderData,
|
||||
initialData,
|
||||
initialDataUpdatedAt: -1,
|
||||
}, queryClient);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue