Enhancement
Code
console.log(icache.getOrSet('foo', 'a'));
icache.set('foo', undefined);
console.log(icache.getOrSet('foo', 'b'));
Expected behavior:
logs:
Actual behavior:
logs:
This is due to there actually being a wrapper around all values in the cache, so getOrSet will never be called again, regardless of value.
We should probably define the undefined semantics here. Does setting a value to undefined mean it's empty and then getOrSet should call the setter here? Or should we have an explicit unset api? or should we have both?