Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
WaitWake lets you wait for an event to happen again, even if it has already happened once, then wakes you up
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json
test.js

README.md

Build Status

waitwake

WaitWake lets you wait for an event to happen again, even if it has already happened once, then wakes you up

As many functions as you wanted can be added to a channel by name, then you can wake them all up by calling wake on that channel name.

API

wait(name, cb)

Wait on a channel name. The callback will be called when that channel is woken up.

Returns an object with a cancel method:

cancel()

Removes the function from the list of functions waiting for the callback to complete.

wake(name)

Wake up a channel by name. This calls all the callbacks that are waiting on that channel and have not been cancelled.

clean()

If a channel has been emptied by cancelling waits, this will remove it. It goes through all channels and checks that something's waiting on them. Then it removes the channel if nothing's waiting for it.

Something went wrong with that request. Please try again.