Update documentation comment for invalidationBehavior
It seems the default value invalidationBehavior does not accurately reflect the documentation comment.
The comment describes the default value as immediately.
Looking at the default set of options here it seems the default value is set to delayed.
const optionsWithDefaults: CreateApiOptions<any, any, any, any> = {
reducerPath: 'api',
keepUnusedDataFor: 60,
refetchOnMountOrArgChange: false,
refetchOnFocus: false,
refetchOnReconnect: false,
invalidationBehavior: 'delayed',
...options,
extractRehydrationInfo,
...
If I understand this correctly, the comment needs to be updated. Apologies if I've got this wrong!
Thanks for your hard work on this library!
+1. This can cause issues with listeners that need to immediately respond to fulfilled queries. I had a scenario where it created an odd discrepancy where an API request succeeded but in the listener logic, the state wasn't up to date because the cache tags hadn't been invalidated (yet, because they were delayed).
Good find on the comment, thank you!
Good spot - PRs welcome :)
Looks like this was fixed in #4555