Re:Show HN: Build your first real world React.js application
by lhnz on Wednesday September 07, 2016 @07:49PM
(#12449018)
That's not actually a good idea: https://github.com/acdlite/redux-actions/issues/20#issuecomm...
[ Parent
| on HN ]
Re:Show HN: Build your first real world React.js application
by biscarch on Thursday September 08, 2016 @02:15PM
(#12455592)
You link to a comment which indicates serialization is a potentially breaking issue. This is a tradeoff that does not affect the routine behavior of redux but may affect advanced use cases such as allowing user upload of action history for bug reports.
Regardless of serialization/replay-ability, the core of the suggestion is to `import` some constant instead of using raw strings. Symbols have the benefit of forcing an import, whereas a list of constants that reference strings can be "bypassed" by writing the correct string in a random file. In fact, the redux actions documentation uses the following example of this pattern as the first example.
``` // fileA const ADD_TODO = 'ADD_TODO'
//fileB { type: ADD_TODO, text: 'Build my first Redux app' } ```