Closed felquis closed 6 years ago
The standard fetch function does not have a tap either, it is bluebird specific method, but I just ignored that fact for simplicity.
tap
For the browser it would be something like:
const toJson = response => response.json() const tap = data => { console.log(data) return data } fetch('https://api.ipify.org?format=json') .then(toJson) .then(({ ip }) => fetch(`https://geoip.nekudo.com/api/${ip}/en`)) .then(toJson) .then(tap)
The standard fetch function does not have a
tap
either, it is bluebird specific method, but I just ignored that fact for simplicity.For the browser it would be something like: