Michaël De Boey
e4efc39939
Use funding key in package.json instead of postinstall script ( #666 )
...
* Delete postinstall.js
* Update package.json
2020-06-29 17:30:17 -06:00
Michaël De Boey
4cdcd18fce
Update FUNDING.yml ( #665 )
2020-06-29 17:05:54 -06:00
Edgardo Di Gesto
63c32ec4ec
Update README.md ( #660 )
v2.4.5
2020-06-29 09:39:59 -06:00
Vladislav Shkodin
b3e4dda9fd
fix(types): Default Error type for setQueryData function ( #659 )
2020-06-29 09:39:13 -06:00
Cory House
8a3752f73c
docs: Fix bad link and typo ( #658 )
2020-06-29 09:38:25 -06:00
Jelte Liekens
bb3535d0ea
fix(types): improve v2 types ( #655 )
...
* fix(types): add variables argument to onError and onSettled and add generic TSnapshot
* refactor(types); add generic result type in BaseQueryOptions
2020-06-29 09:37:41 -06:00
allcontributors[bot]
1c51a8b8fc
docs: add bugzpodder as a contributor ( #653 )
...
* docs: update README.md [skip ci]
* docs: update .all-contributorsrc [skip ci]
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-06-29 02:59:46 -06:00
Kevin Sullivan
7527457174
fix(types): v2 ( #626 )
...
v2.4.4
* enable types, update simpleQuery
* update MutationState
* stricter query type
Co-authored-by: Michaël De Boey <info@michaeldeboey.be>
* verify imports
* verify import 2
* update fetchMore
* move ready condition to enabled
* update MutateOptions
* update config
* fix QueryResulltBase
* remove queryKey function
* remove duplicate type
* update prefetch
* functions are not valid queryKeys
* add option to queryFn, formatting
* Add dtslinting to ci test
* remove deprecated variables
* add types to formatting
* add resetErrorBoundaries
Co-authored-by: Michaël De Boey <info@michaeldeboey.be>
2020-06-28 18:01:27 -06:00
Tanner Linsley
fd9c8a1b81
refactor: break out query and queryInstance into their own files
2020-06-28 17:10:49 -06:00
Tanner Linsley
5057043dfc
docs: comments on noop promise
2020-06-28 14:40:54 -06:00
Kevin Sullivan
ac11bdca0e
style: prettier formatting ( #647 )
...
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
2020-06-28 14:27:01 -06:00
Tanner Linsley
54d549ec4c
Update test-and-publish.yml
2020-06-28 13:46:02 -06:00
Tanner Linsley
ae9c1101ef
Update test-and-publish.yml
2020-06-28 10:21:13 -06:00
Tanner Linsley
50329b39a1
fix(invalidateQueries): respect enabled flag
...
v2.4.3
Fixes #648
2020-06-28 10:16:06 -06:00
Fran Guijarro
fa42ae98ab
fix(setQueryData). When there is no previous instance of the query it tries to create a new one but the type signature was incorrect ( #644 )
2020-06-27 21:33:12 -06:00
Bishwendu Kundu
db5a51e087
fix(query-cache): Prevent re-run of query for refetch interval if update is disabled ( #640 )
...
v2.4.2
* fix(query-cache): Prevent re-run of query based on refetch interval if update is disabled
* Update src/core/queryCache.js
Co-authored-by: Bishwendu Kundu <bishwendu.kundu@broadcom.com>
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
Fixes #635
2020-06-26 23:56:00 -06:00
Jack Zhao
53e8424041
fix: disabling query in suspense mode ( #643 )
2020-06-26 23:48:21 -06:00
Tanner Linsley
ac2a21f730
Merge branch 'master' of https://github.com/tannerlinsley/react-query
2020-06-26 23:27:53 -06:00
Tanner Linsley
7cd1af1b47
refactor: Move infinite query logic into queryCache
2020-06-26 23:27:51 -06:00
Will Tanna
dbef0382f5
tests: Add callback tests for useMutation ( #641 )
...
Adds callback tests for when the `mutate` function is called multiple
times in a row.
2020-06-26 21:57:30 -06:00
Tanner Linsley
5a5ad749e7
fix(useMutation): ensure all side-effects are always called
...
v2.4.1
Fixes #249
Now all we need is the new test from #641
2020-06-26 19:19:51 -06:00
Tanner Linsley
2de852896b
chore: Reorganize code to core + react
2020-06-26 10:03:45 -06:00
0xflotus
bcecb5476e
(docs): fixed small errors ( #636 )
2020-06-25 13:25:10 -06:00
Tanner Linsley
ce25ffa5da
Update README.md
2020-06-25 10:45:30 -06:00
Tanner Linsley
d7048d1c35
feat: add initialStale option to queries
...
v2.4.0
By default `initialData` is not considered stale, but sometimes you may want it to be, for instance, if your initial data is only a partial subset of an object and you know you will need to refetch the full version immediately after mounting. For this, you can use the `initialStale: true` options.
By setting `initialStale` to `true`, the `initialData` will be considered `stale` and will cause a refetch when the query mounts for the first time.
```js
function Todos() {
const queryInfo = useQuery('todos', () => fetch('/todos'), {
initialData: todoListPreview,
initialStale: true,
})
}
```
2020-06-25 10:38:50 -06:00
Tanner Linsley
8ec83f43fa
Merge branch 'master' of https://github.com/tannerlinsley/react-query
v2.3.0
2020-06-25 09:47:21 -06:00
Tanner Linsley
9a734f617d
feat: add refetchInactive option to invalidateQueries
...
Normally, inactive queries do not refetch when they are invalidated, but you can now use the `refetchInactive: true` option to force them to refetch.
2020-06-25 09:47:19 -06:00
Kent C. Dodds
4712c0d4d7
fix: prefetchQuery args check ( #631 )
v2.2.3
2020-06-24 23:17:04 -06:00
Tanner Linsley
0054f7ffff
fix(prefetchQuery): add prefetchQuery(key, options) overload
v2.2.2
2020-06-24 19:35:07 -06:00
Kurt Furbush
340e4adefb
Typo ( #630 )
2020-06-24 19:28:23 -06:00
Tanner Linsley
ab0fbeaf3f
Update README.md
2020-06-24 18:41:06 -06:00
Tanner Linsley
660ef1e73c
Update package.json
2020-06-24 18:34:26 -06:00
Tanner Linsley
a68dc28727
fix: queryKeySerializer now in the right spot of the config
v2.2.1
2020-06-24 17:17:43 -06:00
Tanner Linsley
ef5becbb15
Update README.md
2020-06-24 16:51:16 -06:00
Tanner Linsley
2a31f8d005
feat: add default quernFn option
...
v2.2.0
This feature allows you to set a default query function in the config and use it for your whole app, similar to how early SWR user's were just passing a url. Now you can do the same and just do `useQuery('/todos')` :)
2020-06-24 16:49:11 -06:00
Tanner Linsley
0bf38da923
chore: revort index in basic example
2020-06-24 16:41:48 -06:00
Tanner Linsley
c9afbc9ddf
fix: call onSuccess for all query instances
2020-06-24 16:40:44 -06:00
Tanner Linsley
a05cb5073f
fix: call onSuccess for all query instances on
...
Fixes #629
2020-06-24 16:07:14 -06:00
Tanner Linsley
a5148284ff
Merge branch 'master' of https://github.com/tannerlinsley/react-query
2020-06-24 14:36:00 -06:00
Tanner Linsley
e770a78140
docs: remove experiemental custom query key serializers
2020-06-24 14:35:57 -06:00
Kent C. Dodds
1e1e0f67e6
fix: don't schedule garbage collection unnecessarily ( #627 )
...
This doesn't actually fix the issue I'm looking into, but I did notice that this timeout is scheduled even when the query is cleared and I *think* it shouldn't be. If we do need to garbage collect something, that should happen in `clear` I think.
2020-06-24 12:19:12 -06:00
David Meade
6922cda1f1
docs(README) typo fix ( #623 )
2020-06-24 12:14:20 -06:00
Tanner Linsley
0147a8ee1f
Update README.md
2020-06-24 12:11:02 -06:00
Tanner Linsley
fd280eca7e
fix: query.state.isFetching defaults to the loading status, despite lack of data
...
v2.1.1
Fixes #624
2020-06-24 11:58:59 -06:00
Tanner Linsley
4c741f7499
feat: added queryCache.resetErrorBoundaries
...
v2.1.0
Info can be found in the docs under the `Resetting Error Boundaries` section
2020-06-24 11:45:13 -06:00
Tanner Linsley
8519dd4d6d
Merge branch 'master' of https://github.com/tannerlinsley/react-query
v2.0.4
2020-06-24 10:39:23 -06:00
Tanner Linsley
c3e42c44af
fix(refetchOnWindowFocus): stale queries are no longer refetched
2020-06-24 10:39:15 -06:00
mrroll
bc40a0d5b0
docs: Typo fix ( #612 )
2020-06-24 10:29:27 -06:00
mick mcmahon
8a401304ca
Update README.md ( #613 )
...
Typo - Yay!!!! I contributed!!
2020-06-24 10:29:15 -06:00
Dávid Kizivat
7c32aa4b51
chore(types): Add missing params for mutation types ( #617 )
...
* fix(types): Add variable to mutate function
The MutateFunction didn't accept variables when not undifined as expected
* fix(types): Add onMutateValue param to onError mutate option
2020-06-24 10:29:00 -06:00