- window.Echo.private(`Tournament.${id}`)
- .listen('ResultReported', e => {
- console.log(e);
+ 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 => {