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);
});
});
});
});
hack2k18
1.0.3 • Public • PublishedPackage Sidebar
Install
npm i hack2k18
Repository
Weekly Downloads
3
Version
1.0.3
License
MIT
Unpacked Size
3.57 kB
Total Files
3