Design pattern for managing multiple asynchronous JavaScript operations

前端 未结 3 1502
暖寄归人
暖寄归人 2020-12-12 16:05

I\'m looking for a good design pattern for keeping track of a bunch of different asynchronous JavaScript activities (images loading, multiple AJAX calls, sequenced AJAX call

3条回答
  •  萌比男神i
    2020-12-12 16:10

    Take a look at the concept of Promises/A. jQuery implements this with the jQuery.Deferred object.

    Here is a nice article showing how it could be useful for your situation. I asked a similar question a while back.

提交回复
热议问题