Skip to content

Commit

Permalink
README: clarify connect evnet
Browse files Browse the repository at this point in the history
  • Loading branch information
nkzawa committed Oct 20, 2014
1 parent 0b34836 commit 0770af8
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ serve the file `socket.io.js` found at the root of this repository.
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io('http://localhost');
socket.on('connect', function(){
socket.on('event', function(data){});
socket.on('disconnect', function(){});
});
socket.on('connect', function(){});
socket.on('event', function(data){});
socket.on('disconnect', function(){});
</script>
```

Expand All @@ -30,10 +29,9 @@ Socket.IO is compatible with [browserify](http://browserify.org/).

```js
var socket = require('socket.io-client')('http://localhost');
socket.on('connect', function(){
socket.on('event', function(data){});
socket.on('disconnect', function(){});
});
socket.on('connect', function(){});
socket.on('event', function(data){});
socket.on('disconnect', function(){});
```

## API
Expand Down Expand Up @@ -144,7 +142,7 @@ reconnect that depend on this `Manager`.

#### Events

- `connect`. Fired upon connecting.
- `connect`. Fired upon a connection including a successful reconnection.
- `error`. Fired upon a connection error
Parameters:
- `Object` error data
Expand Down

0 comments on commit 0770af8

Please sign in to comment.