redux-saga / redux-saga-beginner-tutorial

Redux/Redux-saga beginner tutorial
MIT License
587 stars 544 forks source link

error when with export default funcion in 1.1 beginnerTutorial #9

Open iLeonelPerea opened 8 years ago

iLeonelPerea commented 8 years ago

An issue because you export like default function and show the following error: check sagaMiddleware.run(saga, ...args): saga argument must be a Generator function!

export default function* rootSaga() { yield [ helloSaga(), watchIncrementAsync() ] }

you need change to:

export function* rootSaga() { yield [ helloSaga(), watchIncrementAsync() ] }

artarmstrong commented 8 years ago

Actually I believe it was meant to have the default assigned to it they can switch the import from using something similar to:

import { rootSaga } from './sagas'

to use the default:

import rootSaga from './sagas'