Skip to content

Commit a8beb1b

Browse files
committed
update readme
1 parent 0b73194 commit a8beb1b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,23 +366,25 @@ then set the provider:
366366
**listening to messages**
367367

368368
```Javascript
369-
EmbarkJS.Messages.listenTo({topic: ["achannel", "anotherchannel"]}).then(function(message) { console.log("received: " + message); })
369+
EmbarkJS.Messages.listenTo({topic: ["topic1", "topic2"]}).then(function(message) { console.log("received: " + message); })
370370
```
371371

372372
**sending messages**
373373

374374
you can send plain text
375375

376376
```Javascript
377-
EmbarkJS.Messages.sendMessage({topic: "achannel", data: 'hello world'})
377+
EmbarkJS.Messages.sendMessage({topic: "sometopic", data: 'hello world'})
378378
```
379379

380380
or an object
381381

382382
```Javascript
383-
EmbarkJS.Messages.sendMessage({topic: "achannel", data: {msg: 'hello world'}})
383+
EmbarkJS.Messages.sendMessage({topic: "sometopic", data: {msg: 'hello world'}})
384384
```
385385

386+
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)```
387+
386388
Tests
387389
======
388390

0 commit comments

Comments
 (0)