Skip to content

Expose list of keys that are cached by a loader #6

@dashed

Description

@dashed
// naive cache invalidation strategy

myLoader.clearAll();
myLoader.loadMany([1, 2, 3]); // list of keys is computed

// ... later
myLoader.clearAll();
myLoader.loadMany([2, 3, 4]); // compute new list of keys

The list of keys that are loaded would need to be tracked externally to determine the set of keys to clear:

// want to get this:
[1, 2, 3] \ [2, 3, 4] = [1]

For this to work, this._promiseCache would need to be officially exposed (e.g .cachedKeys()).

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions