Running into an unintended side effect of using modularized components.
I have a modularized button component that
A. Takes in a parameter based on table selection
B. Runs an api request based on that parameter
C. Saves a file based on that parameter after api request is complete
Naturally, modularized components do not lock the parameter that we pass in on execution of an api request, so if If I have a table
- item1 <-- currently selected
- item2
- item3
and run my modularized button component, then quickly select a new item before the api request finishes
- item1
- item2
- item3 <-- currently selected
This would result in
A. Takes in a parameter based on table selection <-- item1
B. Runs an api request based on that parameter <-- item1
C. Saves a file based on that parameter after api request is complete <-- item3
Unfortunately, there is no way to expose the state of the modularized component in the dashboard it's being used in. (check to see if an api request is running for example). Therefore there's no way to prevent this undesired behavior, and this likely is the case for any modularized component that has post-api event handlers