I have a code having following structure. Basically my requirement is that onChange of option in "SELECT" f5 should run followed by f1. And inside f1 - first f2 must run and when done then f3 must run. Completion of f2 means it also must ensure that f4 is run and completed. I mean to have the flow maintained because if some function to be finished earlier is left behind then my whole program becomes waste. I guess deferred has the solution hence I tried using it with pipe. But as I am not well versed in maintaining this flow I am not able to get my expected results. Please help if you can.
<script>
function f1(){
function f2(){
....
f4();
....
}
function f3(){
....
}
}
function f4(){}
function f5(){}
</script>
....
<select onChange=f5().pipe(f1) >
......
</select>
when done- are you talking about asynchronous execution or just linear?