0.0.1 • Published 11 years ago
louie v0.0.1
louie
Louie is a timeable loop for executing tasks written in JavaScript.
Getting Started
var louie = new Louie();
louie.addTask({
timeout: 10000,
task: function() {
console.log('called after 10000ms');
}
});
louie.addTask({
timeout: 50000,
task: function() {
console.log('called after 15000ms');
}
});
louie.start();API
addTask(task)
Adds a task to the queue. task is an object with the properties task and timeout (optional).
louie.addTask({
timeout: 1000,
task: function() {}
});getTasks()
Returns an Array of tasks.
tasks = louie.getTasks()isRunning()
Can be used to check if the loop is running.
louie.isRunning()start()
Starts the loop.
louie.start()
louie.isRunning() // truestop()
Stops the loop.
louie.stop()
louie.isRunning() // falseLicense
Licensed under the MIT license.
0.0.1
11 years ago