A promise is a special JavaScript object that links the “producing code” and the “consuming code” together.A “consuming code” that wants the result of the “producing code” once it’s ready.For instance, some code that loads the data over a network. A “producing code” that does something and takes time.This is a real-life analogy for things we often have in programming: And even if something goes very wrong, say, a fire in the studio, so that you can’t publish the song, they will still be notified.Įveryone is happy: you, because the people don’t crowd you anymore, and fans, because they won’t miss the song. They can fill in their email addresses, so that when the song becomes available, all subscribed parties instantly receive it. To get some relief, you promise to send it to them when it’s published. Imagine that you’re a top singer, and fans ask day and night for your upcoming song.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |