3 ms·
That's not actually a good idea: https://github.com/acdlite/redux-actions/issues/20#issuecomment-134340125 https://github.com/acdlite/redux-actions/issues/20#is
by lhnz 10y ago
That's not actually a good idea: https://github.com/acdlite/redux-actions/issues/20#issuecomment-134340125 https://github.com/acdlite/redux-actions/issues/20#issuecomm...
- biscarch 10y agoYou 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' } ```
- deleted 10y ago[deleted]