Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpdaniels committed Oct 14, 2014
1 parent 94a1c69 commit c8edcae
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
rx.wamp
=======

A wrapper library for the autobahn wamp v2 library in the browser/node
A wrapper library for the autobahn wamp v1/v2 library in the browser/node


### Connection
Expand Down Expand Up @@ -113,7 +113,7 @@ session.callObservable("wamp.my.add", [2, 3], {}, {})
console.log("Result was %s", value.args[0]);
});

//TODO Shorthand
//Shorthand
var add = session.caller("wamp.my.add");

add([2, 3]).subscribe(function(value) {
Expand All @@ -122,6 +122,47 @@ add([2, 3]).subscribe(function(value) {
});
```

## V1

It also supports the v1 library.


### Subscribing

```javascript

//Notice the difference between this and v2
session.subscribeObservable("wamp.subscribe.event")
.subscribe(function(event) {
console.log("New event: %s", event);
});

```

### Publishing

```javascript

session.publishObservable("wamp.publish.event", {id : "me"}, true)
.subscribeOnCompleted(function(){});

```

### Calling methods

```javascript

session.callObservable("wamp.my.add", 2, 3)
.subscribe(function(value){
console.log("Result was %d", value);
});



```




###TODO

Expand Down

0 comments on commit c8edcae

Please sign in to comment.