hack2k18
v1.0.3
Published
``` const SocketClient = require('hack2k18');
Downloads
2
Readme
const SocketClient = require('hack2k18');
// either local or deployed, specify host
const client = new SocketClient('ws://hack2k18.azurewebsites.net/');
const profile = {
name: 'mastaWu',
location: 'VA'
};
client.connect(profile);
client.on('connected', service => {
// get results
service.query();
// results returned
service.on('query', results => {
// select
service.select('brewery');
// select confirmation
service.on('selected', selected => {
// pay
service.pay('brewery');
// pay confirmation
service.on('paid', receipt => {
console.log(receipt);
});
});
});
});