I have a list of items, each item has a state and event handler (I am using the setTimeout to simulate the case.) to update the state.
When I remove item 1 from the list, the state of item 2 becomes "aa0" not "bb" or "N.A".
After the setTimeout function is executed, the state of item 2 resumes normally.
Unfortunately, in my real development environment, the event may not be triggered after the item list is updated.
Would you tell me why? and is there any best practice to fix the problem?
Here is my source code for your reference: