React Native Debugger:为什么我不能在我的 Redux 传奇中设置断点?



我在 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")行放置一个断点。调试器不会让我这样做。如果我单击将断点放在那里,它会将其放在function* providersList(action)行上方。

谁能帮我理解为什么会这样?

以这种方式放置您的debugger,并从developer menu和打开console of chrome debugger启用debug

if (response.Message === "Success"){
debugger       // you have to add this line.
yield put(ProvidersActionCreators.providersListSuccess(response.Providers))
}

最新更新