在Javascript中,函数*表示法是什么意思?

时间:2017-06-22 01:39:40

标签: javascript ecmascript-6

阅读https://github.com/redux-saga/redux-saga的文档,他们有一个我不熟悉的功能表示法:

// worker Saga: will be fired on USER_FETCH_REQUESTED actions
function* fetchUser(action) {
   try {
      const user = yield call(Api.fetchUser, action.payload.userId);
      yield put({type: "USER_FETCH_SUCCEEDED", user: user});
   } catch (e) {
      yield put({type: "USER_FETCH_FAILED", message: e.message});
   }
}

功能* 是什么意思?

0 个答案:

没有答案