Skip to content

Commit

Permalink
It's always prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed May 27, 2023
1 parent 0963bae commit 79c122b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/svelte/auto-refetching/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
const addMutation = createMutation({
mutationFn: (value: string) =>
fetch(`${endpoint}?add=${value}`).then((r) => r.json()),
onSuccess: () => client.invalidateQueries({ queryKey: ['refetch']}),
onSuccess: () => client.invalidateQueries({ queryKey: ['refetch'] }),
})
const clearMutation = createMutation({
mutationFn: () => fetch(`${endpoint}?clear=1`).then((r) => r.json()),
onSuccess: () => client.invalidateQueries({ queryKey: ['refetch']}),
onSuccess: () => client.invalidateQueries({ queryKey: ['refetch'] }),
})
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
onMutate: async (newTodo: string) => {
text = ''
// Cancel any outgoing refetches (so they don't overwrite our optimistic update)
await client.cancelQueries({queryKey: ['optimistic']})
await client.cancelQueries({ queryKey: ['optimistic'] })
// Snapshot the previous value
const previousTodos = client.getQueryData<Todos>(['optimistic'])
Expand All @@ -72,7 +72,7 @@
},
// Always refetch after error or success:
onSettled: () => {
client.invalidateQueries({queryKey: ['optimistic']})
client.invalidateQueries({ queryKey: ['optimistic'] })
},
})
</script>
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte/playground/src/routes/AddTodo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
let name = ''
const postTodo = async ({ name, notes }: { name: string, notes: string }) => {
const postTodo = async ({ name, notes }: { name: string; notes: string }) => {
console.info('postTodo', { name, notes })
return new Promise((resolve, reject) => {
setTimeout(() => {
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte/playground/src/routes/EditTodo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
editingIndex,
} from '../lib/stores'
type Todo = { id: number, name: string, notes: string }
type Todo = { id: number; name: string; notes: string }
const queryClient = useQueryClient()
Expand Down

0 comments on commit 79c122b

Please sign in to comment.