Today, I have a challenge that I need to trigger JS function at the end of chained of process, to click on an item menu (alert) on GUI to expand it. This JS function is available to use. I thought that I can watch on the status of alert to make the trigger decision or not. Technically, I will save the old alert status, then end of process, I will check if any different between old and new status, I will trigger JS. The questions are when and where we will execute it.
I was thinking about callback and track the status in back-end. Unfortunately, this callback supported from current framework is executed before the action I want to do it first. So if I want to continue with this solution, I have to introduce a new callback, and make sure that it’s the last one be executed.
The second solution is I will always trigger JS, then calculate the alert status in front-end.
Note that I have only 4 hours to complete it.
|complicated algorithm||introduce callback
tracking alert status by object (supported from libs)
|timting||problem with callback. the rest is no problem||time to learn about array, hash code of object|