-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Hi! I'm playing around with ddp.js. I'm trying to build a client that speaks to a meteor server over ddp. But the behaviour i'm seeing is odd. Chances are I'm missing something fundamental.
I have something like this on the client:
var options = {
endpoint: "ws://localhost:3000/websocket",
SocketConstructor: WebSocket
};
var ddp = new DDP(options);
ddp.on("connected", function () {
console.log("Connected");
var methodId = ddp.method("testMethod");
ddp.on("result", function (message) {
console.log(message);
});
});
testMethod:
Meteor.methods({
testMethod: function(){
return "herro";
}
});
ddp.on("connected") gets triggered as one would expect. However ddp.on("result") does not. When going into the Chrome network console and looking at the DDP-messages being recieved by the client.
{"msg":"result","id":"0","result":"herro"}
But the on() function doesn't react to the event.
Tell me what I'm doing wrong =)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels