dolejska-daniel / riot-api-base Goto Github PK
View Code? Open in Web Editor NEW⚙ Generic base for simple Riot API wrapper implementation.
License: GNU General Public License v3.0
⚙ Generic base for simple Riot API wrapper implementation.
License: GNU General Public License v3.0
Hello, was there any change with the way asynchronous requests are done on the latest meta package?
I've recently tried migrating my project from riot-api
v4.1 to riot-api-base
+ riot-api-league
v1.0. The synchronous requests seem to work correctly, however the promise do not seem to resolve when the requests are called asynchronously.
Here's an example of code I was using with the previous version:
// fetch an ongoing game
$game = $api->getCurrentGameInfo($summonerId);
$summoners = [];
foreach ($participants as $participant) {
// fetch the league entries for each of the games participants
$api->nextAsync(
function ($entryDto) use ($participant): void {
//on success add the participants'LP to the summoners array
$summoners[$participant->summonerId] = $entryDto->leaguePoints;
},
function (Exception $error) use ($participant): void {
// otherwise add null
$summoners[$participant->summonerId] = null;
},
'entries'
)->getLeagueEntriesForSummoner($participant->summonerId);
}
$this->api->commitAsync('entries');
This was working fine with v4.1, but silently fails on v1.0. Any idea what the reason could be ?
Hey , I'm Getting this error after updating to version 5.0 and trying to use $api->getTimeline('BR1_123456');
is there anything i can do to fix it ?
Obs: if i try this code after the async it does not work , if i try before the async it works fine.
Originally posted by @Lucasnl in dolejska-daniel/riot-api-league#1 (comment)
Hello,
The v1.1 version is not the latest with my patch inside it.
Could you please tag a new version ?
Tahnks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.