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 function #1993

Closed
jacekbogdanski opened this issue May 21, 2018 · 6 comments
Closed

Throttling function #1993

jacekbogdanski opened this issue May 21, 2018 · 6 comments
Labels
changelog:api A changelog entry should be put in the API section of the changelog. status:confirmed An issue confirmed by the development team. target:major Any docs related issue that should be merged into a major branch. type:feature A feature request.
Milestone

Comments

@jacekbogdanski
Copy link
Member

jacekbogdanski commented May 21, 2018

Type of report

Feature request

Provide description of the new feature

Throttling function is required to implement #1972 feature. We need a throttling function that can accept, and pass arguments in the throttled function.

Note that the function should work the same way as eventBuffer does in terms of being called, so, say you have a throttling set to 100 ms and you have following calls:

call no. time offset (relative to first call)
1 0ms
2 20ms
3 40ms
4 120ms

The throttled function should be executed thee times with following offsets:

time offset
0ms
100ms
200ms

Please see #1983 (comment) discussion for more information about requirements.

Differences from tools.eventsBuffer

  • It passes arguments.
  • In case of eventsBuffer it schedules first defered call, throttle should always overwrite the scheduled call with the last one.
@jacekbogdanski jacekbogdanski added type:feature A feature request. status:confirmed An issue confirmed by the development team. labels May 21, 2018
@mlewand mlewand added changelog:api A changelog entry should be put in the API section of the changelog. target:major Any docs related issue that should be merged into a major branch. labels May 21, 2018
@mlewand mlewand added this to the Backlog milestone May 21, 2018
@mlewand
Copy link
Contributor

mlewand commented Jun 1, 2018

Pull request has been merged to the Autocomplete feature branch (#1751). It will automatically get merged with it.

@mlewand mlewand modified the milestones: Backlog, 4.10.0 Jun 1, 2018
@mlewand
Copy link
Contributor

mlewand commented Jun 19, 2018

Fixed in #1751.

@mlewand mlewand closed this as completed Jun 19, 2018
@fahamjv
Copy link

fahamjv commented Dec 1, 2019

plugin.js?t=H4PG:160 Uncaught TypeError: CKEDITOR.tools.throttle is not a function
at new TextWatcher (plugin.js?t=H4PG:160)
at Autocomplete.getTextWatcher (plugin.js?t=H4PG:413)
at new Autocomplete (plugin.js?t=H4PG:200)
at new Mentions (plugin.js?t=H4PG:125)
at plugin.js?t=H4PG:26
at Object.forEach (ckeditor.js:48)
at a. (plugin.js?t=H4PG:25)
at a.n (ckeditor.js:10)
at a. (ckeditor.js:12)
at a.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js:13)

@skuchibhotla
Copy link

skuchibhotla commented Dec 14, 2020

I am also getting the very same error what @fahamjv had mentioned in his last post. Is there a known resolution to this issue? I don't see a throttle() function in CKEDITOR.tools. Or, am I missing something?

Screen Shot 2020-12-14 at 3 32 42 PM

@Dumluregn
Copy link
Contributor

Hello, you can find the CKEDITOR.tools.throttle() method in both API docs and code, so I don't understand the problem here. As for the error, we need the reproduction steps and demo that lead to it - without it we are not able to tell anything. Please, create a new issue and follow the issue template you'll encounter.

@skuchibhotla
Copy link

skuchibhotla commented Dec 16, 2020

@Dumluregn Thank you for such a prompt reply. It was a mistake at my end. After going through the documentation, realized I needed to upgrade my CKEditor to a later version to have the throttle() function since it was introduced in 4.11.0. Thank you once again :) I hope this fixes the issue at my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:api A changelog entry should be put in the API section of the changelog. status:confirmed An issue confirmed by the development team. target:major Any docs related issue that should be merged into a major branch. type:feature A feature request.
Projects
None yet
Development

No branches or pull requests

5 participants