0.0.1 • Published 9 years ago

louie v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

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() // true

stop()

Stops the loop.

louie.stop()
louie.isRunning() // false

License

Licensed under the MIT license.