In the previous implementation the variable auto was being declared in the global scope. This was causing that multiple calls to the autoWaiter function were attempting to redeclare the function thus the error message mentioned by @daattali: Uncaught SyntaxError: Identifier 'auto' has already been declared
By declaring the auto variable within the scope of the callback when listening to shiny:recalculating we avoid this problem
How to test
Here we have an example shiny app (see below) that uses two modules with autoWaiter pointing to an specific id. In this example you'll see that the first autowaiter called will work as expected while the second one won't (see gif)
Closes #139
Thanks for this awesome package!
Changes in this PR
In the previous implementation the variable
auto
was being declared in the global scope. This was causing that multiple calls to theautoWaiter
function were attempting to redeclare the function thus the error message mentioned by @daattali:Uncaught SyntaxError: Identifier 'auto' has already been declared
By declaring the
auto
variable within the scope of the callback when listening toshiny:recalculating
we avoid this problemHow to test
Here we have an example shiny app (see below) that uses two modules with
autoWaiter
pointing to an specific id. In this example you'll see that the first autowaiter called will work as expected while the second one won't (see gif)With the changes in this PR looks like this
Example app