Question

The realtime api documentation indicates that the set method of CollaborativeMap should return the previous value at the given key, if there is one. Instead, it seems to return some object that has the old value as a property.

var map = doc.getModel().createMap();
map.set('key', 'val');
var oldValue = map.set('key', 'val2');
console.log(oldValue === 'val1'); // false
console.log(oldValue); // Tm {a: ""val"", Pa: Object, K: function, pa: function, J: function…}
Was it helpful?

Solution

It looks like an internal data structure in the Realtime API is being returned instead of the intended value. Thanks for reporting this issue - we're looking into it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top