Closed Kahss closed 3 years ago
Hi,
I have an action which may receive a boolean parameter. However, it seems it always consider the false values as undefined. I have to use this trick to ensure that it does what I want
false
undefined
socket_playerTurn(context: ActionContext<GameStateData, RootStateData>, myTurn: boolean) { if (myTurn === undefined) { myTurn = false; } context.commit('set_turn', myTurn); },
The action works when myturn === true but not when myturn === false, any idea why ?
myturn === true
myturn === false
It seems that the problem is located in socket.io rather than here, mea culpa.
Hi,
I have an action which may receive a boolean parameter. However, it seems it always consider the
false
values asundefined
. I have to use this trick to ensure that it does what I wantThe action works when
myturn === true
but not whenmyturn === false
, any idea why ?