dimanche 4 janvier 2015

How to check is there a module runned with Yabble?


I use Yabble inside of Windows Phone 8.1 app. I run a module this way.



require.setModuleRoot('/js/');
require.run('main');


When I go to the page with this code first time, everything is fine, but if I go to the page second time it runs the main module again and it causes some troubles. main.js file contains an infinite game loop which draws something on canvas. So the second instance of main.js conflicts with the first one. Is there a way to check if the main.js already runned to prevent it from running again?





Aucun commentaire:

Enregistrer un commentaire