1
0
Fork 0
mirror of https://github.com/sbrl/soundbox.git synced 2018-01-10 21:33:43 +00:00

Fix Promise

This commit is contained in:
Starbeamrainbowlabs 2017-07-31 18:53:56 +01:00
parent f2af3336c1
commit 35b62d4506

View file

@ -5,7 +5,7 @@ function SoundBox() {
if(typeof callback == "function") if(typeof callback == "function")
this.sounds[sound_name].addEventListener("canplaythrough", callback); this.sounds[sound_name].addEventListener("canplaythrough", callback);
else else
return new Promise((resolve, reject) => this.sounds[sound_name].addEventListener("canplaythrough", resolve)); return new Promise((resolve, reject) => this.sounds[sound_name].addEventListener("canplaythrough", resolve), this.sounds[sound_name].addEventListener("error", reject));
}; };
this.remove = function(sound_name) { this.remove = function(sound_name) {