Don’t call my callback too early
Don’t call my callback too late
Don’t call my callback too few times
Don’t call my callback too many times
Make sure to provide my callback with any necessary state/parameters
Make sure to notify me if my callback fails in some way
Oh my god, these apply to every function call in my application! Promises are the hammers to all the nails!
10
u/ihsw Jul 10 '16
I think it is.
Callback hell is over, promises and async/await have won.
I challenge you to find any new ES6/TypeScript projects that still use anonymous functions for asynchronous execution.