Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Running Multiple Instances #104

Open
jackrugile opened this issue Nov 19, 2019 · 0 comments
Open

Issue with Running Multiple Instances #104

jackrugile opened this issue Nov 19, 2019 · 0 comments

Comments

@jackrugile
Copy link

Hey, I am trying to run two instances of Sketch.js on two different canvases. However, my demo will only run the latest Sketch.js instance that was created. I've created a reduced test below that shows the issue.

https://codepen.io/jackrugile/pen/1cd4ff94228f26fbd3775d5e9bc04dd9

You can confirm this by commenting out the second instance of the creation starting at line 15.

I am suspecting there is something going wrong with either the start(), running, dt, or millis properties when using multiple instances. You can see how they output different values in my console log interval at line 31:

setInterval(function() {
  console.log('---');
  console.log('a.dt:', a.dt, 'b.dt:', b.dt);
  console.log('a.millis:', a.millis, 'b.millis:', b.millis);
  console.log('a.running:', a.running, 'b.running:', b.running);
}, 1000);

I even tried adding a manual a.start() call, but a always reports running to be false.

I am not sure how the inner working of Sketch.js handle multiple instances, but there could be an issue there. If there's a solution for this, let me know. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant