javascript - detect end of chained functions?

前端 未结 3 855

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条回答
  •  梦毁少年i
    2021-01-25 21:05

    You can write the sequencer, which will help you to do this for you. Instead of executing direct calls, shift the names of the functions and call them one by one. Something like this

    executeSequence(func1('init_dat'),[
        'func2',
        'func3',
        'func4'
    ]);
    

提交回复
热议问题