Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Bougarfaoui El houcine authored Feb 28, 2017
1 parent 715f72d commit 0aeb26f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class AppModule { }

```

Now you can inject ```SocketOne```, ```SocketTwo``` in any other service and / or components.
Now you can inject ```SocketOne```, ```SocketTwo``` in any other services and / or components.


## API
Expand All @@ -129,7 +129,7 @@ Sends a message to the server.
Optionally takes a callback.
Works the same as in Socket.IO.

### `socket.fromEvent(eventName: string): Observable<any>`
### `socket.fromEvent<T>(eventName: string): Observable<T>`
Takes an event name and returns an Observable that you can subscribe to.

You should keep a reference to the Observable subscription and unsubscribe when you're done with it.
Expand Down Expand Up @@ -159,7 +159,7 @@ class ChatService {

getMessage() {
return this.socket
.fromEvent("message")
.fromEvent<any>("message")
.subscribe((message) => {
// todo
});
Expand Down

0 comments on commit 0aeb26f

Please sign in to comment.