takeEvery$1 requires a pattern or channel react native

Viewed 577

My Saga index file

import { fork, spawn, all } from 'redux-saga/effects'
import * as authSagas from './authSagas'
import * as configSagas from './configSagas'
import * as applicationSagas from './applicationSagas'
import * as timeTrackingSagas from './timeTrackingSagas'
import * as clientSagas from './clientSagas'
import * as schedulerSagas from './schedulerSagas'
import * as rbmaSagas from './rbmaSagas'
import * as workflowTrackingSagas from './workflowTrackingSagas'

import { startWatchingNetworkConnectivity } from './networkSagas'

export default function* rootSaga(store) {
  yield all([
    spawn(startWatchingNetworkConnectivity),
  ])
  yield fork(authSagas.watchAuthSagas, store)
  yield fork(configSagas.watchConfigSagas, store)
  yield fork(applicationSagas.watchApplicationSagas, store)
  yield fork(timeTrackingSagas.watchTimeTrackingSagas, store)
  yield fork(clientSagas.watchClientSagas, store)
  yield fork(schedulerSagas.watchSchedulerSagas, store)
  yield fork(rbmaSagas.watchRBMASagas, store)
  yield fork(workflowTrackingSagas.watchWorkflowTrackingSagas, store)
}

My Saga file

    import { WORKFLOWTRACKING_ACTIONS, STORAGE } from 'constants'
import {
    WORKFLOW_TRACKING_CREATE,
    WORKFLOW_TRACKING_UPDATE,
    WORKFLOW_TRACKING_DELETE
} from '../constants/api'
import AsyncStorage from '@react-native-community/async-storage'
import {
    takeEvery, put, call, select,
    delay,
} from 'redux-saga/effects'
// import { TIMETRACKING_ACTIONS,  } from 'constants'
import { timeTrackingActions, configActions, applicationActions, authActions, workflowTrackingActions } from 'actions'
import { processRequest } from 'services/Api'
import { RootNavActions } from 'services/NavigationActions'

import { reverse } from 'lodash'
import { updateSavedCount } from '../actions/applicationActions'
import { getDateInFormat } from "../helpers/dateTimeHelper"
import { populateTimeTrackingForEditing } from '../helpers/timetrackingHelper'
import { logBackEnd } from '../lib/api'

function* handleWorkflowtrackerDelete(action) {
    try {
        const {
            typeKey, trackingKey, typeValue, startDate, endDate,
        } = action.payload

        yield call(processRequest, WORKFLOW_TRACKING_DELETE(typeKey, trackingKey), 'DELETE', null, {}, true)
        yield put(workflowTrackingActions.workflowTrackingDeleteSuccess())
        yield put(timeTrackingActions.getTimetrackingDetails(typeValue, startDate, endDate))
        yield put(applicationActions.toggleLoading(false))
        yield call(RootNavActions.navigate, 'TimeTracking')
        yield delay(1000)
        yield put(timeTrackingActions.clearMessage())

    } catch (e) {
        const { response } = e || {}
        const { data } = response || {}
        const { error } = data || {}

        yield put(configActions.notConnected(yield call(getSavedCount)))
        yield put(timeTrackingActions.timeTrackingDeleteFailure(error))
    }
}

export function* watchWorkflowTrackingSagas() {

    yield takeEvery(WORKFLOWTRACKING_ACTIONS.WORKFLOW_TRACKING_DELETE, handleWorkflowtrackerDelete)
}
0 Answers
Related