Attempt an operational transformation and if the result is not valid JSON then fail

This commit is contained in:
Caleb James DeLisle
2016-02-11 12:34:06 +01:00
parent e16299b5c4
commit 37db31b09e
2 changed files with 6 additions and 0 deletions

View File

@@ -1163,6 +1163,7 @@ module.exports.create = function (userName, authToken, channelId, initialState,
Common.assert(typeof(initialState) === 'string');
var realtime = ChainPad.create(userName, authToken, channelId, initialState, conf);
return {
Operation: Operation,
onPatch: enterChainPad(realtime, function (handler) {
Common.assert(typeof(handler) === 'function');
realtime.patchHandlers.push(handler);