This commit is contained in:
Erik 2015-09-18 12:28:28 -04:00
parent f464eba995
commit b0cf8d2c40
2 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ socket.on("currentAmount") {data, ack in
socket.emit("update", ["amount": cur + 2.50]) socket.emit("update", ["amount": cur + 2.50])
} }
ack?("Got your currentAmount", "dude") ack <- ["Got your currentAmount", "dude"]
} }
} }
@ -39,7 +39,7 @@ SocketIOClient* socket = [[SocketIOClient alloc] initWithSocketURL:@"localhost:8
[socket emit:@"update" withItems:@[@{@"amount": @(cur + 2.50)}]]; [socket emit:@"update" withItems:@[@{@"amount": @(cur + 2.50)}]];
}); });
ack(@[@"Got your currentAmount, ", @"dude"]); [ack with:@[@"Got your ack, ", @"dude"]];
}]; }];
[socket connect]; [socket connect];

View File

@ -34,11 +34,11 @@ public class SocketAckEmitter: NSObject {
self.ackNum = ackNum self.ackNum = ackNum
} }
public func ackWith(items: [AnyObject]) { public func with(items: [AnyObject]) {
socket.emitAck(ackNum, withItems: items) socket.emitAck(ackNum, withItems: items)
} }
} }
public func <-(lhs: SocketAckEmitter?, rhs: [AnyObject]) { public func <-(lhs: SocketAckEmitter?, rhs: [AnyObject]) {
lhs?.ackWith(rhs) lhs?.with(rhs)
} }