0

我在 Redux 传奇中有以下代码:

function* providersList(action) {
    yield put(LoadingActionCreators.start(Actions.PROVIDERS_LIST));
    yield put(ErrorActionCreators.clear(Actions.PROVIDERS_LIST));

    try {
        const response = yield call(
            PostRequest,
            'providers/list',
            {
                AuthorizationKey: authorizationKey,
                CustomerID: action.customerID
            }
        );
        if (response.Message === "Success")
            yield put(ProvidersActionCreators.providersListSuccess(response.Providers))
        else
            yield put(ErrorActionCreators.set(Actions.PROVIDERS_LIST, new Error('PROVIDERS_LIST ERROR')));
    } catch (error) {
        yield put(ErrorActionCreators.set(Actions.PROVIDERS_LIST, error));
    }
    yield put(LoadingActionCreators.end(Actions.PROVIDERS_LIST));
}

我正在使用 React Native 调试器,并且想在该if (response.Message === "Success")行放置一个断点。调试器不会让我这样做。如果我单击将断点放在那里,它会将它放在上面的 line 处function* providersList(action)

谁能帮我理解这是为什么?

4

1 回答 1

0

debugger以这种方式放置您的并debugdeveloper menu并打开console of chrome debugger

if (response.Message === "Success"){
       debugger       // you have to add this line.
       yield put(ProvidersActionCreators.providersListSuccess(response.Providers))
   }
于 2020-05-15T08:18:13.450 回答