JSFiddle - React, Tailwind, and code Playground

JavaScript

const cityAPI = 'https://www.mocky.io/v2/5a945fa435000074009b0e78';
const weatherAPI = 'https://www.mocky.io/v2/5a947dfa35000072009b0eb9?city=';

function asyncGetCity() {
    return fetch(cityAPI).then(response => response.json());
}

function asyncGetWeather(city) {
    return fetch(weatherAPI+city).then(response => response.json());
}

return asyncGetCity()
    .then(function (city) {
        return asyncGetWeather(city.name);
    })
    .then(function(weather) {
        console.log(weather.temp + weather.unit);
    });