-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add maxAge
option
#27
Conversation
Add a lazy max age implementation that remove expired items on get, peek or has method calls
3f9c3f8
to
c08f4f5
Compare
- Use Date.now() - Prefix max Age test
Done ;). Thanks for the comments |
Can you fix the merge conflict? |
- Increase test maxAge time
…into feat/add-max-age
In the |
mm depending what we want if we want that has return true for items that has been expired we can remove that part, but if has will return false for expired elements, there is the need to get the element first to verify the expiration time :S |
Can you do a test where |
- Clean the code - Rename tests - Change max age description
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Done, I called the set option maxAge to options = { maxAge } and set maxAge globaly by default Infinity instead of 0 that sure it makes more sense ;) |
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Add a lazy max-age implementation that lacy removes expired items on get, peek, or has method calls. Hope the implementation fits on your library :).
Closes #18