생성자를 사용할 때 문제가 있습니다. 나는 콘솔에서 다음과 같은 오류가 발생합니다 : 여기 자바 생성기 콘솔의 구문 오류
가ERROR in ./app/redux/sagas/tracking.saga.js Module build failed: SyntaxError: C:/Workspace/teamable-frontend/app/redux/sagas/tracking.saga.js: Unexpected token (18:4)
package.json
입니다 :
{
"devDependencies": {
"autoprefixer-loader": "^3.2.0",
"babel-cli": "^6.4.5",
"babel-core": "^6.4.5",
"babel-loader": "^6.2.1",
"babel-plugin-transform-runtime": "^6.12.0",
"babel-polyfill": "^6.9.1",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.5.0",
"babel-runtime": "^6.11.6",
...
}
...
}
그리고 webpack.config
에서 로더 :
module: {
loaders: [{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react', 'stage-0'],
plugins: ["transform-runtime"]
}
},
...
}
그리고 발전기를 사용하여 기능 :
import {put, call} from 'redux-saga/effects';
import {takeEvery} from 'redux-saga';
import {LOAD} from '../../constants/ActionTypes';
import {loadTrackingItemsSuccess, loadTrackingItemsFail} from '../actions/tracking.actions';
import {getTrackingItems} from '../../mocks/ListMock'
function* loadTrackingItems() {
try {
const trackingItems = yield call(getTrackingItems);
yield put(loadTrackingItemsSuccess(trackingItems));
} catch(ex) {
yield put(loadTrackingItemsFail(ex.toString()));
}
}
export function watchTrackingItemsLoad() {
yield* takeEvery(LOAD, loadTrackingItems);
}
을
내가 뭘 잘못 했니?
우 남자, 무슨 바보 같은 실수! 고마워요! –