Skip to content

memoizer.sync() behaviour for rejected promises is inconsistent with memoizer() behaviour for errored callbacks #34

@ighunter

Description

@ighunter

When using memoizer({load: (..., callback) => {...}}), and the callback gets called with an error, the result is not cached.

When using memoizer.sync({load: async (...) => {...}}, and the promise gets rejected, the rejected promise is retained in the cache.

We would like it if the rejected promise was automatically removed from the cache. This would technically be a breaking change, so perhaps making it an option that defaults to false would be best?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions