From a8beb1bf8c3e895937d575bd8eb401d66a34cd20 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sat, 7 Jan 2017 10:42:11 -0500 Subject: [PATCH] update readme --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9301bdfdb..337bf41f8 100644 --- a/README.md +++ b/README.md @@ -366,7 +366,7 @@ then set the provider: **listening to messages** ```Javascript - EmbarkJS.Messages.listenTo({topic: ["achannel", "anotherchannel"]}).then(function(message) { console.log("received: " + message); }) + EmbarkJS.Messages.listenTo({topic: ["topic1", "topic2"]}).then(function(message) { console.log("received: " + message); }) ``` **sending messages** @@ -374,15 +374,17 @@ then set the provider: you can send plain text ```Javascript - EmbarkJS.Messages.sendMessage({topic: "achannel", data: 'hello world'}) + EmbarkJS.Messages.sendMessage({topic: "sometopic", data: 'hello world'}) ``` or an object ```Javascript - EmbarkJS.Messages.sendMessage({topic: "achannel", data: {msg: 'hello world'}}) + EmbarkJS.Messages.sendMessage({topic: "sometopic", data: {msg: 'hello world'}}) ``` +note: array of topics are considered an AND. In Whisper you can use another array for OR combinations of several topics e.g ```["topic1", ["topic2", "topic3"]]``` => ```topic1 AND (topic2 OR topic 3)``` + Tests ======