Closed faboulaws closed 6 years ago
@faboulaws can you explain well your use case, what exactly you want to achieve?
Here you propose a solution, but I'd love to know what problem we're really solving, that we way we can both pickup best solution :)
Also mind there's a v1 version design proposed, and in that version you'll be able to observe events for all cache operations per memoized function.
Still as delivery date of v1 is uncertain, I'll be happy to add some improvements to v0.4, assuming it doesn't require any significant work and doesn't break things.
@faboulaws as I didn't get any feedback I'm closing this. I also believe that all you need will be provided with v1
First off, thank for writing such a great module. I love it.
I know the profiler is only for development purpose but it can do so much more. I would like to suggest the option to pass a custom profiler or listener. The current profiler ('memoizee/profiler') not only works as a global profiler but does not work when it is required after a function was memoized . In other words, any function memoized before
require('memoizee/profiler')
is not profiled(correct me if I am wrong). This has some limitations.What I am suggesting is an additional option so that we can have a different listener per function memoized. The listener (or profiler) can have a event handler for each of the configure-map (see ) events:
The current profiler can be used as a default profiler:
Example
Just a suggestion.
Thanks