// 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?