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

throttling-feature added #237

Closed
wants to merge 1 commit into from
Closed

Conversation

kunukn
Copy link

@kunukn kunukn commented Mar 30, 2017

Hey, now that 1.6.0 is released, could you prepare a PR with your code from http://codepen.io/kunukn/full/bgjzpb/? I'd merge it and release as 1.7.0. I guess the throttle function could be simplified a bit, because we won't be using leading/trailing options.

To test this. You use this in the app.js

signaturePad = new SignaturePad(canvas, {
  throttle: 16 // x milli seconds
});

The throttle.js is 34 lines and is from Underscore. Well-tested and production ready.

I tried this 22 lines example which could be used instead.
https://remysharp.com/2010/07/21/throttling-function-calls

I tried this 12 lines example, but could not get it to work correctly with my Codepen example. Not sure why.
http://sampsonblog.com/749/simple-throttle-function

@szimek szimek added this to the 2.1 milestone Apr 1, 2017
@szimek
Copy link
Owner

szimek commented Apr 2, 2017

@kunukn Big thanks for this feature, especially that it took so long to add... I've just released 2.1.0-beta.1 with it and if nobody finds any issues, I'll release it as 2.1.0 soon.

BTW. I set throttling to 16 by default.

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

Successfully merging this pull request may close these issues.

2 participants