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

Don't memoize undefined #103

Open
earonesty opened this issue Oct 31, 2018 · 1 comment
Open

Don't memoize undefined #103

earonesty opened this issue Oct 31, 2018 · 1 comment
Assignees

Comments

@earonesty
Copy link

earonesty commented Oct 31, 2018

Feature idea: tell memoizee not to memoize a result.

Right now if i never want to memoize an undefined result, i have to write a wrapper lambda that deletes it right after memoizee adds it. Which is OK. But it woudl be cool if there was an optional argument:

memoized = memoize(afn, { promise: true, except:(res)=>{res == undefined} })

I can submit a pull req if you like the idea.

@medikoo
Copy link
Owner

medikoo commented Oct 31, 2018

This is similar request to: #102

For composition reasons I would keep it out of memoizee internals, still can you describe the use case in more detail?

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

No branches or pull requests

2 participants