Jump to content


Photo
Question

EventEmit & Promise

node.js node-steam-user

  • Please log in to reply
1 reply to this topic

#1 Ins

Ins

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 11 July 2019 - 05:29 AM

When working with your library there was a difficulty...

How can i promise example here:

botInfo = {};

client.logOn(logOnOptions);

client.on('wallet', function(hasWallet, currency, balance) {
    botInfo.balance = balance;
});

client.on('emailInfo', function(address, validated) {
    botInfo.emailAddress = address;
    botInfo.emailValidated = validated;
});

console.log(botInfo); // i want to log data after fill info

no one promise don't work....



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,137 posts

Posted 11 July 2019 - 04:31 PM

I suggest that you study up on JavaScript asynchronous callbacks.







Also tagged with one or more of these keywords: Question, node.js, node-steam-user

4 user(s) are reading this topic

0 members, 4 guests, 0 anonymous users