New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: optional refresh strategy (stale-while-revalidate) #533 #586
Conversation
@jonathanarezki thanks for doing this pull request. I will be reviewing this in the next 10 days and get back to you on this. |
Also, please make sure to update your branch to the latest. |
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #586 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 283 292 +9
Branches 72 75 +3
=========================================
+ Hits 283 292 +9
📢 Have feedback on the report? Share it here. |
@jonathanarezki can you update the readme with this new functionality? |
update: README.md
update: README.md
# Conflicts: # README.md
I updated the readme. |
update: tests to be less time sensitive in slow environments
@jonathanarezki - thanks and since this is not a non breaking change I will add it to the next release which should go out in the next couple weeks. |
Thank you really much. I didn't expect it to go that smooth. |
Added refresh threshold, to update stores before the ttl runs out.
Only the wrap function is affected.
If the the remaining ttl of a store is smaller than the refresh threshold,
the store gets set with the fn asynchronously.
The refresh threshold is optional and is not stored in the store it self, only in the cache instance as a config.