es6顶级箭头函数

es6顶级箭头函数

//函数声明

const thunk = (store) => next => action =>

        typeof action === 'function' ?
            action(store.dispatch, store.getState) :

            next(action);


//函数调用
thunk('function')("function")("af")



//声明函数,并指定返回值(如使用箭头函数声明方法并将方法体使用小括号时,小括号中的数据就为该函数的返回数据)

const handel = (state) => ({
    value: {name:'as'}
});


-> handel("asasa")

<- value:{name:'as'}



验证码: 看不清楚?