0

I have the following code in a Redux saga:

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));
}

I'm using React Native debugger, and want to put a breakpoint at the if (response.Message === "Success") line. The debugger won't let me do this though. If I click to put the breakpoint there, it instead puts it above at the line function* providersList(action).

Can anyone help me understand why this is?

gkeenley
  • 6,088
  • 8
  • 54
  • 129

1 Answers1

0

Put your debugger in this way and enable debug from the developer menu and open console of chrome debugger.

if (response.Message === "Success"){
       debugger       // you have to add this line.
       yield put(ProvidersActionCreators.providersListSuccess(response.Providers))
   }
Waheed Akhtar
  • 3,110
  • 1
  • 16
  • 30