But sooner you will find that the user may click submit button multiple times. You can add a state(flag) the first time the user click submit button and prevent further clicks before the signup function complete.
Here we will introduce another approach of how we use reapex to handle this. Similar to mutations side effects, we can define side effects for any UI events. These non-mutation side effects are called triggers
In the example above, we defined a side effect called signup which only gets triggered when it's called specifically. Like in the example, it calls the signup side effect when clicking on the submit button. However, it only takes the first onClick event(with takeLeading) and ignores all the further clicks before the side effect finished.