+ window.Echo.channel(`Tournament.${id}`)
+ .listen('ApplicationAdded', e => {
+ if (e.application) {
+ setTournament(tournament => patchApplication(tournament, e.application));
+ }
+ })
+ .listen('ApplicationChanged', e => {
+ if (e.application) {
+ setTournament(tournament => patchApplication(tournament, e.application));
+ }
+ })
+ .listen('ParticipantChanged', e => {
+ if (e.participant) {
+ setTournament(tournament => patchParticipant(tournament, e.participant));
+ }
+ })
+ .listen('ResultChanged', e => {
+ if (e.result) {
+ setTournament(tournament => patchResult(tournament, e.result));
+ }
+ })