I have a javascript file where I let the user set some values as an exported function looks something like this setValues(1,'test')
. In this set call I set an eventlistener on a button to call a function document.querySelector('#spinner').addEventListener('click', spin);
this calls the function spin(). I would like to get the results back from this and have the user be able to call getResults()
and the user would be able to view the results from spin().
I am aiming to export both setValues()
and getResults()
so the user can import the module and use the functions. How can I get it so getResults will properly show the user the values?