Only suggestion i can think of is that your method strongly implies a
requirement that "repetitionsPollFn.repeat()" get assigned to a
variable so it can be cleared later:
var interval = repetitiousPollFn.repeat(0.5);
// interval is the setInterval ID
then later
window.clearInterval(interval);
i
You might also want to look at the already existing
PeriodicalExecuter.
Any implementation of a Function#repeat API should take this in
account.
On Jun 24, 2:55 pm, "joe t." wrote:
> Only suggestion i can think of is that your method strongly implies a
> requirement that "repetitionsPollFn.repe
I can't say I'm a big fan of this. For several reasons.
First, it's just a cosmetic replacement for setInterval(myfunction
(...).bind(), ...) which simply isn't all that bad.
Second, I'm not a fan of setInterval in general. I've seen some
rather nasty behavior with calls queuing up if the invo
I had the very same problem and solved it by changing the order:
1) include jquery
2) setting jQuery.noConflict().
3) include prototype & scriptaculous
On 13 Jun., 04:00, swindsor wrote:
> Hey all,
>
> I'm running into a pretty severe bug with protoype 1.6 (and 1.5) with
> firefox 2.0.0.20
>
>
This is fantastic feedback - thanks!
On Wed, Jun 24, 2009 at 9:55 AM, Robert Kieffer wrote:
>
> I can't say I'm a big fan of this. For several reasons.
>
> First, it's just a cosmetic replacement for setInterval(myfunction
> (...).bind(), ...) which simply isn't all that bad.
>
> Second, I'
I've subbed my implementation with your to do some use-case testing. I'll
report back anything of interest as I go along.
Rick
On Wed, Jun 24, 2009 at 10:49 AM, Rick Waldron wrote:
> This is fantastic feedback - thanks!
>
>
>
>
>
>
> On Wed, Jun 24, 2009 at 9:55 AM, Robert Kieffer wrote:
>
>>
>
I made a few modifications to your version, allowing repeat() to behave like
delay() with regard to arguments
I've posted a demo here:
http://jsbin.com/ekone
All the output is to the firebug console... i've included fbug lite just in
case
Rick
On Wed, Jun 24, 2009 at 10:50 AM, Rick Waldr
Just to clarify the above: Prototype Core already contains a similar
functionality: PeriodicalExecuter. The API is different but the
functionality is the same.
I'd strongly suggest looking into combining both approaches if you
want your suggestion to be included in core and not just stay a thread
I use Function.prototype.watch instead of Abstract.TimedObserver
Function.prototype.watch = function(delay,onChange){
var __method = this,
value= __method();
return setInterval(function(){
var v = __method();
if(v!==value){
onChange(v);
value = v;
FWIW, PeriodicalExecuter has always struck me as a bit of a wart on
the Prototype API. The name and usage are awkward, and it's
functionality really feels like something that should just be a
Function extension, as we're seeing in this thread. I'm assuming it's
presence is mostly a legacy thing.
Tobie,
I had in fact looked into PeriodicalExecuter and to be perfectly honest,
with no offense intended, i think it's usage syntax is hideous which is what
led me to writing my own Function.prototype method instead, taking
inspiration from .delay()
It doesnt matter to me whether or not .repeat()
Thanks, I am using jquery. I'll give this a try!
- scott
On Jun 24, 7:17 am, upi wrote:
> I had the very same problem and solved it by changing the order:
> 1) include jquery
> 2) setting jQuery.noConflict().
> 3) include prototype & scriptaculous
>
> On 13 Jun., 04:00, swindsor wrote:
>
> >
Hi Rick, hi Robert.
Fully agree regarding PE. It does however handle issues a regular
setInterval doesn't (as you mentioned).
It's clearly an area which would need refinement, but that's better
done in a backwards compatible way.
Personally, I'd love to see PE implemented as a method of Functio
13 matches
Mail list logo