Closed puzrin closed 8 years ago
There will be dedicated promise
mode for that, it's handled at https://github.com/medikoo/memoizee/issues/35 Until then workaround as proposed in comments should be made.
I'm closing it as duplicate of #35
Thanks! Did not found that issue when created a new one.
I'm rewriting a lot of code from callbacks to yield + promises. Would like to find a nice solution to memoize results from db in new style.
I can memoize sync function, that return
Promise
. That looks ok until promise fails - such result should not be reused. Any ideas how to deal with it?PS. I know i can use old style internals and promisify memoized function, but that's not beautiful.