From dedf0be0b9b54fe25d755323e967714194a09a20 Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 16 Mar 2021 19:47:42 +0000 Subject: [PATCH] adding documentation comment to explain new isFromSockets property --- src/store/modules/players.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/store/modules/players.js b/src/store/modules/players.js index 30d4d2b..9a7ab0f 100644 --- a/src/store/modules/players.js +++ b/src/store/modules/players.js @@ -102,6 +102,14 @@ const mutations = { set(state, players = []) { state.players = players; }, + /** + The update mutation also has a property for isFromSockets + this property can be addded to payload object for any mutations + then can be used to prevent infinite loops when a property is + able to be set from multiple different session on websockets. + An example of this is in the sendPlayerPronouns and _updatePlayerPronouns + in socket.js. + */ update(state, { player, property, value }) { const index = state.players.indexOf(player); if (index >= 0) {