-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
...
function getObject() { return { a: { b: true } }; }
var o = cache.get('object', getObject);
o.a.b // => true
o.a = { b: false }
var p = cache.get('object', getObject);
// expected p.a.b => true
p.a.b // => false
...The expected behaviour of the stored cache object should be what the cache function returns.
Problem probably lies in that the stored cache object being returned as reference rather than value, as is normal JS behaviour, and mutation of non-primitives mutates the reference value.
Easy solution is to clearly state this behaviour in the docs as this might lead to some confusion.
Metadata
Metadata
Assignees
Labels
No labels