Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Change open event to connect to match socket.io #1

Merged
merged 2 commits into from

2 participants

@rschmukler

No description provided.

@olalonde olalonde merged commit c9a312a into olalonde:master
@rschmukler rschmukler deleted the rschmukler:connect_emit_fix branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 9, 2013
  1. @rschmukler
  2. @rschmukler

    Updated Demo App

    rschmukler authored
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 6 deletions.
  1. +4 −4 demo.js
  2. +2 −2 mtgox.js
View
8 demo.js
@@ -8,7 +8,7 @@ var lastTickerPrice = -1;
var lastTickerVolume = -1;
var client = mtgox.connect();
-client.on('open', function() {
+client.on('connect', function() {
// Good place to unsubscribe from unwanted channels
// client.unsubscribe(mtgox.getChannel('trade').key);
// client.unsubscribe(mtgox.getChannel('depth').key);
@@ -73,12 +73,12 @@ var getDepthFormat = function(depth) {
}
else {
format += '- '.grey;
- };
+ }
if (depth.type_str == 'ask') {
format += 'Ask: '.grey.bold;
}
- else if (depth.type_str = 'bid') {
+ else if (depth.type_str == 'bid') {
format += 'Bid: '.grey.bold;
}
@@ -93,7 +93,7 @@ var getDepthFormat = function(depth) {
var getTickerFormat = function(ticker, lastPrice) {
var format = '> ';
-
+
var last = 'Last: '.bold;
var high = 'High: '.bold;
var low = 'Low: '.bold;
View
4 mtgox.js
@@ -55,8 +55,8 @@ var MtGoxClient = function() {
self.emit('error', error);
});
- socket.on('open', function() {
- self.emit('open');
+ socket.on('connect', function() {
+ self.emit('connect');
});
socket.on('close', function() {
Something went wrong with that request. Please try again.