Skip to content

Commit 3256c87

Browse files
committed
onsubscribe using encodeFunction
1 parent d01471d commit 3256c87

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/api/encode.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ dop.encode = function(data, encoder) {
33
if (typeof encoder != 'function')
44
encoder = dop.core.encode;
55
return JSON.stringify(data, encoder);
6+
};
7+
dop.encodeFunction = function(data) {
8+
return JSON.stringify(data, dop.core.encodeFunction);
69
};

src/protocol/onsubscribe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dop.protocol.onsubscribe = function(node, request_id, request) {
1515

1616
if (dop.core.registerSubscriber(node, object_root))
1717
response.push(object_root);
18-
dop.core.storeSendMessages(node, response);
18+
dop.core.storeSendMessages(node, response, dop.encodeFunction);
1919
return object;
2020
}
2121
else if (value === undefined)

0 commit comments

Comments
 (0)