-
Notifications
You must be signed in to change notification settings - Fork 15
Quicker example #3
Copy link
Copy link
Open
Description
supersniff looks neat and I was thinking if you're quickly debugging it might be a hassle to have to put the import/require statement at the top of each file whenever you want to use it. I was thinking you could also do this:
fetch(`http://myapi.com/users/${username}.json`))
.then(response => response.json())
.then(require('supersniff')) // Will console.log out the parsed json, and return the value,
// effectively passing it on to the next .then
.then(user => Promise.all(user.friends.map(friend => getFriend(friendId))))
.then(friends => /* do even more stuff here */)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels