Skip to content

Commit

Permalink
docs: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
João Pedro Magalhães authored Aug 29, 2022
1 parent c7f4930 commit c58b4b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const usersKeys = createQueryKeys('users');

export const productsKeys = createQueryKeys('products', {
bestSelling: null,
search: (query: string, limit = 15) => ({ query, limit })
search: (query: string, limit = 15) => ({ query, limit }),
byId: (productId: string) => ({ productId }),
});
```
Expand Down Expand Up @@ -108,14 +108,14 @@ Easy way to access the serializable key scope and invalidade all cache for that
```ts
const todosKeys = createQueryKeys('todos', {
single: (id: string) => id,
tag: (tagId: string) => ({ tagId })
tag: (tagId: string) => ({ tagId }),
search: (query: string, limit: number) => [query, { limit }],
});


todosKeys.single('todo_id'); // ['todos', 'single', 'todo_id']
todosKeys.tag('tag_homework'); // ['todos', 'tag', { tagId: 'tag_homework' }]
todosKeys.search('learn tanstack query', 15); // ['todos', 'single', 'learn tanstack query', { limit: 15 }]
todosKeys.search('learn tanstack query', 15); // ['todos', 'search', 'learn tanstack query', { limit: 15 }]

todosKeys.single.toScope(); // ['todos', 'single']
todosKeys.tag.toScope(); // ['todos', 'tag']
Expand Down

0 comments on commit c58b4b3

Please sign in to comment.