代码行未执行或调试器未执行

时间:2019-03-13 11:07:14

标签: javascript reactjs redux redux-saga

我有这个redux saga代码,我试图通过在代码中的某些地方引入调试器来对其进行调试。 这是我要调试的传奇代码。

function* cricketMatchCardClickHandler({ matchId, matchBaseUrl }) {
  try {
    const authToken = yield select(state => state.auth.authToken);
    console.log("authToken", authToken);
    if (!authToken) {
      yield* fetchCricketDraftPlayers({ matchId });
      yield put({ type: RESET_CRICKET_FANTASY_PLAYER_SELECTION });
      history.push(matchBaseUrl + "/pick-players");
    } else {
      debugger; // this debugger gets executed
      const sportsFanDraftGameDetails = yield call(
        getSportsFanDraftGameDetails,
        authToken,
        matchId
      );

      console.log("sportsFanDraftGameDetails", sportsFanDraftGameDetails);
      debugger; // this debugger didn't get executed
      yield put({
        type: FETCH_SPORTS_FAN_DRAFT_DETAILS_SUCCESS,
        response: sportsFanDraftGameDetails
      });
      debugger;
      if (sportsFanDraftGameDetails) {
        history.push(matchBaseUrl + "/dashboard/timeline");
      } else {
        yield* fetchCricketDraftPlayers({ matchId });
        yield put({ type: RESET_CRICKET_FANTASY_PLAYER_SELECTION });
        history.push(matchBaseUrl + "/pick-players");
      }
    }
  } catch (error) {
    debugger;
    console.log(error);
  }
}

我看到甚至控制台日志也没有执行。这到底是什么意思,这与redux传奇有什么关系?我们如何去纠正它?

0 个答案:

没有答案
相关问题