javascript - detect end of chained functions?

前端 未结 3 884

Today I\'m working on a pet project using chained function calls, and I\'m curious how I might detect when the last function in the chain is executed. For example:



        
3条回答
  •  甜味超标
    2021-01-25 20:50

    The traditional approach is to put whatever you want done after the final function on the next line:

    func1('initial data').func2().func3().func4();
    allFunctionsDone();
    

    ;)

提交回复
热议问题