jsbeans

jsbeans  1.0.0

jsbeans > jsbeans > jsbeans.Repeater
Search:
 
Filters

Class jsbeans.Repeater

Invokes periodically a {@param} callback every {@param} frequency seconds.
Partially based upon prototype.js PeriodicalExecuter

Constructor

jsbeans.Repeater ( callback , frequency , [args] )
Parameters:
callback <Function>
frequency <Integer> interval in seconds between two subsequent calls
[args] <Object> arguments for callback

Methods

all

static void all ( )
After this call every Function will be added with a "repeatExtension" method.
Sample usage
function myFun() { // my code here  }
myFun.repeatExtension(5000, 3) // execute myFun 3 times every 5 seconds
myFun.repeatExtension(5000, -1, 'ciccio') // exeute myFun every 5 seconds forever passing string "ciccio" as argument of myFun
Returns: void

start

void start ( )
Starts repeating
Returns: void

stop

void stop ( )
Stops repeating.
Returns: void


Copyright © 2016 Francesco Mele. All rights reserved.