Redux-Saga. Ключевое слово yield всегда возвращает тип неопределенный - PullRequest
0 голосов
/ 30 сентября 2019

Проблема:

Ключевое слово "yield" всегда возвращает тип неопределенный. Что я делаю не так?

Среда:

"react": "16.8.6",
"react-native": "0.60.5",
"react-redux": "^7.1.1",
"redux": "^4.0.4",
"redux-logger": "^3.0.6",
"redux-saga": "^1.1.1",
"redux-thunk": "^2.3.0",
"axios": "^0.19.0"

Код:

function* fetchSomething(): Iterator<any> {
  try {
    const response = yield fetchDogs();
    console.log(response.data.dogs);
  } catch (e) {}
}

const fetchDogs = async (): Promise<AxiosPromise<Array<{ name: string }>>> =>
  await axios(`https://example.com`);

enter image description here

enter image description here

...