From 813a46314acdf512fa9170ba157de466008c95a6 Mon Sep 17 00:00:00 2001 From: ben hockey Date: Fri, 7 Nov 2014 16:21:09 -0600 Subject: [PATCH] use "add" topic for notifying store --- store/notifying.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/store/notifying.js b/store/notifying.js index 8c5cd49..03c97db 100644 --- a/store/notifying.js +++ b/store/notifying.js @@ -25,20 +25,20 @@ exports.Notifying = function(store, options){ if(directives && directives['client-id']){ clientHub = hub.fromClient(directives['client-id']); } - return clientHub.subscribe(path, /*directives.body || */["put", "delete"]); + return clientHub.subscribe(path, /*directives.body || */["add", "put", "delete"]); }; store.unsubscribe = function(path, directives){ var clientHub = hub; if(directives && directives['client-id']){ clientHub = hub.fromClient(directives['client-id']); } - return clientHub.unsubscribe(path, ["put", "delete"]); + return clientHub.unsubscribe(path, ["add", "put", "delete"]); }; var originalPut = store.put; if(originalPut){ store.put= function(object, directives){ if(options && options.revisionProperty){ - object[options.revisionProperty] = (object[options.revisionProperty] || 0) + 1; + object[options.revisionProperty] = (object[options.revisionProperty] || 0) + 1; } var result = originalPut(object, directives) || object.id; if(directives && directives.replicated){ @@ -60,12 +60,12 @@ exports.Notifying = function(store, options){ var result = originalAdd(object, directives) || object.id; if(directives && directives.replicated){ return result; - } + } return when(result, function(id){ localHub.publish({ channel: id, result: object, - type: "put" + type: "add" }); return id; });