Skip to content

Commit

Permalink
Bumped to version 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
evilive3000 committed Nov 25, 2016
1 parent a97af8b commit 8fc81b6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ console.log(polobook.asks)
console.log(polobook.bids)
```

if you need to stop listening for updates from poloniex server, just use `stop` method:
```javascript
polobook.stop()
.then(() => { /* polobook has data but it stop syncing it with server */ });
```

for closing WAMP connection use static method `PoloBook.close`
```javascript
const PoloBook = require('poloniex-orderbook');
const polobook = new PoloBook(['btc', 'eth']);

polobook.start()
.then(() => {
// you've done all stuff and want to finish
PoloBook.close()
});
```
One connection is shared with all orderbook instances, so if you call `PoloBook.close()` you'll loose connection for all instances.
If you want to stop listening only for current orderbook use `stop`.

#####Note:
* You can create different pairs orderbooks, they will work ok simultaneously (see [examples](https://github.com/evilive3000/poloniex-orderbook/tree/master/examples) )
* This module written with `ES6` syntax. Check your nodejs version if you get some errors first.
Expand All @@ -54,7 +74,9 @@ polobook.start().then(() => {
console.log(polobook.asks.slice(0, 10));
console.log('-------------------------');
console.log(polobook.bids.slice(0, 10));
}).catch(error => console.log(error));
})
.then(PoloBook.close)
.catch(error => console.log(error));
```

you should get output like this:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "poloniex-orderbook",
"version": "2.0.0",
"version": "2.1.0",
"description": "Poloniex's orderbook manager",
"main": "index.js",
"dependencies": {
Expand Down

0 comments on commit 8fc81b6

Please sign in to comment.