I have some action types in my app that I've declared like this:
export const TICTACTOE_PLAY = Symbol();
export const TICTACTOE_RESET = Symbol();
Then I wrote some action dispatchers like this:
export const play = coordinates => ({ type: TICTACTOE_PLAY, coordinates });
export const reset = () => ({ type: TICTACTOE_RESET });
I prefer symbols over strings because they are primitive, I believe them to be faster to compare than strings (in the reducer), and they can't collide with each other.
However in the Redux style guide I read that this was an anti-pattern. However, I can't fully understand this sentence:
This ensures that capabilities such as debugging via the Redux DevTools will work as expected. It also ensures that the UI will update as expected.
Why would non-serializable values like symbols prevent Redux DevTools or UI to work as expected? I understand that it may not help debugging, I understand that the state has to be serializable (for use cases like server-side rendering) but I don't get why actions have to be serializable.