[Redux] Avoid action type naming conflicts
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'
// }
[Redux] Avoid action type naming conflicts的更多相关文章
- fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
xxxxxx.lib(xxxxxx.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machin ...
- C++的Public.lib(Public.dll) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
今天开始编译网游服务器,找前辈借来批处理文件,版本控制上拿下代码,库等一系列资源,尼玛啊,编译出错: Public.lib(Public.dll) : fatal error LNK1112: mod ...
- vuex2 mapActions 报错 `unknown action type: xxxx`
export const setBreadCrumb = ({ dispatch }, data) => { dispatch('SET_BREADCRUMB', data) } 当调用的时候报 ...
- 编译Cython代码时遇到的问题: fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
使用python setup.py build_ext --inplace命令编译cython代码, 出现以下错误: Compiling cython_example.pyx because it c ...
- [TypeScript] Avoid any type
To avoid using "any" type is a best pratice. The reason for that is it disable the power o ...
- [Redux] Extracting Action Creators
We will create an anction creator to manage the dispatch actions, to keep code maintainable and self ...
- LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
1 什么是“module machine type” 这个是当前工程要链接的静态库的target machine type. 2 什么是“target machine type” 这个是当前工程生成的 ...
- fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
这个问题很奇怪.原来是/machine:X86 /machine:X64这两个链接器选项一起使用了.所以就冲突了.接手别人的项目就是晕啊.不知道为什么在VS中linker commandline的ad ...
- qt+opencv LNK4272:library machine type 'x64' conflicts with target mathine type 'x86'
运行时报错如上图所示,原因是你使用的opencv库是64位的,qt里面使用的编译器MSVC是32位的,解决方法如下: 将构建套件修改位64bit:
随机推荐
- Spring CORS
转载:Spring MVC 4.2 增加 CORS 支持 http://spring.io/blog/2015/06/08/cors-support-in-spring-framework http: ...
- nagios 安装配置(包含nrpe端)全 (一)
一.nagios安装: 1.安装下面命令: 这是本人监控服务时自己定义插件所用到的几个系统命令.可不安装. (1)iostat:监控磁盘IO信息: apt-getinstall sysstat (2) ...
- docker进入容器的几种方法
一 启动进入容器指定bash 退出后容器关闭 [root@Centos-node3 ~]# docker run -it centos bash [root@83c6b25aca09 /]# 二 do ...
- C++中引用传递与指针传递区别
C++中引用传递与指针传递区别 在C++中,指针和引用经常用于函数的参数传递,然而,指针传递参数和引用传递参数是有本质上的不同的: 指针传递参数本质上是值传递的方式,它所传递的是一个地址值.值传递过程 ...
- node.js服务器核心http和文件读写
使用htpp给客服端的数据,把数据交给浏览器渲染.利用 http创建服务器,如客户端请求为:127.0.0.1:3000或127.0.0.1:3000/xxx.html时 ,判断www文件夹中,文件 ...
- Python 极简教程(四)变量与常量
变量和常量 在 Python 中没有 常量 与 变量 之分.只有约定成俗的做法: 全大写字母的名称即为 常量: PI = 3.1415926 全小写字母的名称为 变量: name = 'nemo' 变 ...
- 原生js大总结三
021.定义函数的几种方式 1.关键字函数:function fnName(){}; 2.字面量函数:var fn = function(){}; 3.构造函数:var fn = new ...
- [置顶]
WebService学习总结(1)——WebService相关概念
一.序言 大家或多或少都听过 WebService(Web服务),有一段时间很多计算机期刊.书籍和网站都大肆的提及和宣传WebService技术,其中不乏很多吹嘘和做广告的成 分.但是不得不承认的是W ...
- js进阶 14-3 如何接收load函数从后台接收到的返回数据
js进阶 14-3 如何接收load函数从后台接收到的返回数据 一.总结 一句话总结:load方法的回调函数的参数即可接收从后台的返回数据. 1.load方法的回调函数的参数是什么? 语法:load( ...
- net基础题
1. 简述 private. protected. public. internal 修饰符的访问权限. 答 . private : 私有成员, 在类的内部才可以访问. protected : 保 ...