Функция сервиса
export const deviceInfoRequest = async (callback) => {
var request = new DeviceInfoMessage();
var AuthToken = 'ciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
client.deviceInfo(request, {'x-authorization': AuthToken}, (err, response) => {
var dataDevicename = response.getDevicename();
var dataDeviceid = response.getDeviceid();
console.log("DeviceName==>>>>",dataDevicename);
console.log("DeviceId==>>>>",dataDeviceid);
this.callback(dataDevicename,dataDeviceid);
});
}
=======> Result of "console.log"=="DeviceName== test" and "DeviceId==>>>> 0xdeadbeef".
Функция саг
function* getDeviceInfo({ payload }) {
try {
const deviceInfoData = yield call(deviceInfoRequest, payload);
console.log("deviceInfoSagasssssssssssssssssssssss", deviceInfoData)
if (deviceInfoData.status === 200) {
yield put(showDeviceInfoAction(deviceInfoData.data));
}
} catch (error) {
}
}
=======> Result of "console.log"=="deviceInfoSagasssssssssssssssssssssss undefined"