Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var coins =[];
- io.sockets.on("connection", function(socket) {
- setInterval( ()={
- getCoinsData(function(error, data) {
- if (error) {
- return console.log(error);
- }
- coins = data;
- socket.emit('message', data);
- });
- }, 10000);
- socket.on("getMycoins",()=>{
- socket.emit("coins_list",coins);
- })
- })
- /* client */
- socket.on("connect",()=>{
- socket.on("coins_list",()=>{
- draw coins table
- })
- })
- setInterval( ()=>{
- socket.emit("getMycoins")
- },1500)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement