In redux, the action type is just a normal string type, it is easy to get naming conflicts in large application.

Can use namespace-constants lib to solve the problem: https://npmdaily.com/pkg/namespace-constants

import constants from 'namespace-constants';

module.exports = constants('todos', [
'ADD_TODO',
'REMOVE_TODO',
'TOGGLE_TODO'
]);
// {
// 'ADD_TODO': 'todos:ADD_TODO',
// 'REMOVE_TODO': 'todos:REMOVE_TODO'
// 'TOGGLE_TODO': 'todos:TOGGLE_TODO'
// }

最新文章

  1. 一次发现underscore源码bug的经历以及对学术界『拿来主义』的思考
  2. Hibernate对象标识符
  3. mongo-c-driver使用VS2013编译
  4. [团队项目]Scrum 项目1.0 (演说视频)NABCD
  5. iOS7 中的statusbar的隐藏和样式更改
  6. linux之pid文件
  7. WPF基础到企业应用系列7——深入剖析依赖属性(WPF/Silverlight核心)
  8. canvas-js贝塞尔曲代码在线生成工具
  9. uva - Broken Keyboard (a.k.a. Beiju Text)(链表)
  10. Matlab立体标定mat转换成Opencv的CvMat
  11. 树状数组(瞎bb) [树状数组]
  12. OpenWRT添加模块 Makefile和Config.in
  13. 浅谈Google Chrome浏览器(理论篇)
  14. linux----------centos下添加环境变量
  15. POJ 3311 Hie with the Pie 【状压DP】
  16. 获取数值型数组的平均值(分别使用增强for循环和普通for循环)
  17. emacs简易配置
  18. vue-cli 打包后显示favicon.ico小图标
  19. hibernate 解决并发问题
  20. 两个有序数组求中位数log(m+n)复杂度

热门文章

  1. [Python] The get() method on Python dicts and its "default" arg
  2. 几个经常使用的cmd命令
  3. FarPoint.Win.Spread 常规操作
  4. 中英文对照 —— 标点符号(punctuation)
  5. Oracle中暂时表空间的清理
  6. php课程 10-35 php实现文件上传的注意事项是什么
  7. php杂项函数
  8. AE要素选择(点选和拉框选择)
  9. Eclipse RCP 中创建自己定义首选项,并能读取首选项中的值
  10. POJ 2185 Milking Grid KMP循环节周期