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…}
有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top