使用gatsbyjs与redux-saga

时间:2018-02-05 10:16:15

标签: redux-saga gatsby

我正在尝试使用gatsby添加redux-saga,但我在控制台上收到错误。

import {put} from "redux-saga/effects";

function* fetchBlog(action) {
    try {
        // const user = yield call(Api.fetchUser, action.payload.userId);
        yield put({type: "BLOG_FETCH_SUCCESS", user: {"const" : 1}});
    } catch (e) {
        yield put({type: "BLOG_FETCH_FAILED", message: e.message});
    }
}

export {fetchBlog};

的src / reduxifier /动作/ blog.js

"babel-plugin-transform-regenerator": "^6.26.0"

我已经在我的dev-dependencies和babelrc文件中添加了{ "presets": ["react", "es2015", "stage-2"], "plugins": [ ["add-module-exports", "transform-runtime", "transform-regenerator"] ] }

Get-ADComputer -Filter{OperatingSystem -NotLike "*server*"} -Properties * | select name,CanonicalName,OperatingSystem,OperatingSystemVersion | Export-Csv C:\Temp\AllComputersOS.csv -NoTypeInformation

你能帮助我吗?

1 个答案:

答案 0 :(得分:0)

您是否也尝试安装regenerator-runtime