mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 12:30:06 +02:00
large performance refactor
This commit is contained in:
@@ -140,6 +140,12 @@ function createPlayerEvents(callbacks: PlayerEventsCallbacks): PlayerEvents {
|
||||
return {
|
||||
cleanup: () => {
|
||||
unsubscribers.forEach((unsubscribe) => unsubscribe());
|
||||
if (callbacks.onUserRating) {
|
||||
eventEmitter.off('USER_RATING', callbacks.onUserRating);
|
||||
}
|
||||
if (callbacks.onUserFavorite) {
|
||||
eventEmitter.off('USER_FAVORITE', callbacks.onUserFavorite);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user