What's bring naming keepUnusedDataFor
instead of CacheLifetime
?
#1514
-
I felt a little bit hard learning RTKQuery first time, but now becoming gradually familiar now I'm really like it RTKQuery! Generally this parameter named like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hmm. Good question. No idea why I chose this honestly.
So it is the time that unused data is still being kept in the cache - as an option: |
Beta Was this translation helpful? Give feedback.
Hmm. Good question. No idea why I chose this honestly.
CacheLifetime
orExpireDate
would both not describe what it does - they key is the "unused" aspect here - keeping data around after no component has subscribed to it any more.CacheLifetime
would imply a lifetime after something has entered the cache - but as long as it is subscribed, there will not be any expiration. Same goes forexpireDate
- that is a fixed date in the future. As long as that data is being used, we don't know it yet.So it is the time that unused data is still being kept in the cache - as an option:
{ keepUnusedDataFor: 60 /* seconds */ }
.