mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-19 13:45:19 -05:00
The callback code in TeamValidator and the functions that use it have
been refactored to use Promises.
Pretty much all signatures have been changed, for instance:
TeamValidator.validateTeamSync(format, team)
-> TeamValidator(format).validateTeam(team)
TeamValidator.validateTeam(format, team, callback)
-> TeamValidator(format).prepTeam(team) // returns a Promise
Validators are no longer cached since they're really lightweight. They
contain a format and a Tools instance, and Tools instances are already
cached in Tools anyway. This saves a tiny bit of RAM in exchange for a
tiny bit of CPU time, but more importantly makes the code more
readable.
I'm introducing a new pattern/API for managing the parts of code with
child processes - their process managers are now at .PM and are now
opt-in, so you can use them synchronously without needing to spawn
any processes.
Fixes #2448
|
||
|---|---|---|
| .. | ||
| COMMANDS.md | ||
| dexsearch.js | ||
| hangman.js | ||
| info.js | ||
| jeopardy.js | ||
| mafia-data.js | ||
| mafia.js | ||
| poll.js | ||
| scavengers.js | ||
| tcgtabletop.js | ||
| thehappyplace.js | ||
| thestudio.js | ||
| trivia.js | ||
| wifi.js | ||