DEV Community

Subho Karmakar
Subho Karmakar

Posted on

How do we declare multiple values to the same variable?

Here's the code -

import axios from "axios"

import { put, takeLatest } from "redux-saga/effects"

import { actions, t } from "./actions"

const baseUrl = "http://host:8082/user/phone"

function* loadUserData(action) {

const response = yield axios.get(`${baseUrl}/${action.name}`)

yield put(actions.loadUserDataSuccess(response.data))

}

export function* watchLoadUserData() {

yield takeLatest(t.LOAD_USER_DATA, loadUserData)

}

Here inline 8 in the response variable, I want to pass for both email and phone URL so that I can search for the result through one search box at once.

Please help!!

Top comments (0)