-
Notifications
You must be signed in to change notification settings - Fork 2k
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
How do you cancel job1 completely before its timeout value occur? #1374
Comments
From @ebidel on December 27, 2014 17:29
Line 53 in 87b3815
We need to document this method: Polymer/old-docs-site#848 |
From @gertcuykens on December 27, 2014 18:26 Let say you have a hover in and hover out where the hover toaster get a delay before it disappears after a hover out. But when you hover back in quick enough you need to cancel that job of disappearing. The thing about |
From @gertcuykens on December 27, 2014 21:12 Currently I do it like this in: function (e){
this.cancel=true
document.querySelector('my-hover').fire('my-hover-in', {'title': title})
},
out: function (e){
this.cancel=false
this.job('myJob', function() {
if (this.cancel) return 0
document.querySelector('my-hover').fire('my-hover-out')
}, 500);
}, But this would be nicer in: function (e){
this.jobCancel('myJob')
document.querySelector('my-hover').fire('my-hover-in', {'title': title})
},
out: function (e){
this.job('myJob', function() {
document.querySelector('my-hover').fire('my-hover-out')
}, 500);
}, |
A little code poking reveals an alternate way of invoking job, using a job handle instead of a string. You can use the handle to stop the job, like this: this.myjob = this.job(this.myjob, function); Big caveat -- this syntax may be deprecated: Line 52 in 87b3815
https://github.com/Polymer/polymer/blob/master/src/lib/job.js#L41 It would be pretty trivial to add a cancelJob method. What say you, @sjmiles ? |
From @gertcuykens on December 30, 2014 22:56 Great thanks, I would never tought of that PS Actually I would deprecate this part haha :)
not the following part because it is nicer and does not mess with polymer internals. return Polymer.job.call(this, job, callback, wait); |
From @ebidel on April 6, 2015 16:50 This issue has gone stale. Marking as obsolete. |
From @gertcuykens on April 6, 2015 19:15 I am happy the github issues are getting cleaned up. I know you all have things to do and I also know allot of them are invalid, but still every open issue is a frustrated user and every polymer team member should know that even it is not there fault. |
Talked to core folks. I'm going to re-open and move this to Polymer/polymer as an 0.8 feature request. |
|
From @gertcuykens on December 27, 2014 3:17
https://www.polymer-project.org/docs/polymer/polymer.html#job
Copied from original issue: Polymer/old-docs-site#847
The text was updated successfully, but these errors were encountered: