Skip to content
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

Is not caching non-promise returning calls the intended behavior? #115

Closed
thgreasi opened this issue Nov 9, 2020 · 1 comment · Fixed by #116
Closed

Is not caching non-promise returning calls the intended behavior? #115

thgreasi opened this issue Nov 9, 2020 · 1 comment · Fixed by #116
Assignees
Labels

Comments

@thgreasi
Copy link
Contributor

thgreasi commented Nov 9, 2020

What is the intended behavior when the provided function throws an error?
While giving this a try, it ends up that the call is not cached, but I couldn't find any mention in the docs or a test case:
https://runkit.com/embed/w29b07kuc7f9

I like how this works currently but I would want to confirm whether this is the intended behavior.
If so, I think it makes sense to mention this in the docs or write a test case, so that we can rely on this behavior in our implementation.

@medikoo
Copy link
Owner

medikoo commented Nov 9, 2020

@thgreasi yes, invocations that crash are not cached. It's intentional. Same with promise mode, if returned promise rejects, then cache is cleared for that invocation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants