原代码:

const fetchPosts = subreddit => dispatch => {

    dispatch(requestPosts(subreddit));

    return common.fetch({url: config.argumentSubmit, method: 'POST'})

    .then(response => response.message)

    .then(message => dispatch(receivePosts(subreddit, message)));

};

解析为:

const fetchPosts = function (subreddit) {

    return function (dispatch) {

            return  common.fetch({url: config.argumentSubmit, method: 'POST'})

                       .then(response => response.message)

                        .then(message => dispatch(receivePosts(subreddit, message)));
}

}

双箭头意思是导出一个函数

es6中的双箭头函数的更多相关文章

  1. 石川es6课程---4、箭头函数

    石川es6课程---4.箭头函数 一.总结 一句话总结: 相当于函数的简写,类似python lambda 函数,先了解即可 let show1 = function () { console.log ...

  2. ES6必知,箭头函数与普通函数的区别。

    1. 箭头函数没有prototype(原型),所以箭头函数本身没有this let a = () =>{}; console.log(a.prototype); // undefined 2. ...

  3. ES6中的高阶函数:如同 a => b => c 一样简单

    作者:Sequoia McDowell 2016年01月16日 ES6来啦!随着越来越多的代码库和思潮引领者开始在他们的代码中使用ES6,以往被认为是"仅需了解"的ES6特性变成了 ...

  4. JavaScript ES6 Arrow Functions(箭头函数)

    1. 介绍 第一眼看到ES6新增加的 arrow function 时,感觉非常像 lambda 表达式. 那么arrow function是干什么的呢?可以看作为匿名函数的简写方式. 如: var ...

  5. es6新特性之箭头函数

    <script> { // es3,es5 var evens = [1, 2, 3, 4, 5]; var odds = evens.map(function (v) { return ...

  6. ES6系列_7之箭头函数和扩展

    1.默认值 在ES6中给我们增加了默认值的操作相关代码如下: function add(a,b=1){ return a+b; } console.log(add(1)); 可以看到现在只需要传递一个 ...

  7. ES6入门五:箭头函数、函数与ES6新语法

    箭头函数的基本用法与特点 函数与ES6新语法 一.箭头函数的基本用法与特点 声明箭头函数采用声明变量和常量的关键字:var.let.const 箭头函数的参数:没有参数用"()"空 ...

  8. js中this,箭头函数和普通函数

    四种基本用法 1. 一般方法中,this代指全局对象 window 2. 作为对象方法调用,this代指当前对象 3. 作为构造函数调用,this 指代new 出的对象 function test() ...

  9. JS中generater和箭头函数

    generater跟函数很像: function* fn(x){ yield x; yield x++; return x;} 如上所示,generater用function*定义,可以用yield返 ...

随机推荐

  1. 关于人人网的form查找和打印

    from lianxi import sessionimport json# urlurl = 'http://www.renren.com/ajaxLogin/login?1=1&uniqu ...

  2. Flask框架基础--第一篇

    1.flask框架和其他几种框架的优缺点对比 Django : 优点 - 大而全所有组件都是有组织内部开发高度定制化 教科书级别的框架 缺点 - 大到浪费资源,请求的时候需要的资源较高 Flask : ...

  3. Memory and Trident(CodeForces 712B)

    Description Memory is performing a walk on the two-dimensional plane, starting at the origin. He is ...

  4. POJO、JavaBean、DTO的区别

    一.POJO(Plain Ordinary Java Object)简单的Java对象,其中有一些属性及其getter setter方法的类,没有业务逻辑(重点理解一下"没有业务逻辑&quo ...

  5. Django_简单的数据库交互案例

    https://www.jianshu.com/p/bd0af02e59ba 一.页面展示 做一个简单的数据库交换的练习案例   页面.png 二.创建mysql 表 (1)创建django (2)创 ...

  6. iis7 设置http 自动跳转到https

    https://www.cnblogs.com/wxbug/p/7054972.html

  7. fineui排序问题

    后台: private void BindGrid()    { // 1.获取当前分页数据        DataSet dataSet = GetPagedDataTable();        ...

  8. .net公众号开发自动回复消息

    using System;using System.Collections.Generic;using System.Web;using System.Web.UI;using System.Web. ...

  9. Mad libs

    Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32 Type &q ...

  10. python字符串编码理解(转载)

    (转载)字符编码和python使用encode,decode转换utf-8, gbk, gb2312 (http://www.cnblogs.com/jxzheng/p/5186490.html) A ...