0.1.1 • Published 10 years ago

signaler v0.1.1

Weekly downloads
8
License
-
Repository
github
Last release
10 years ago

Signaler

Event signaler

Usage

Basic usage

  Signaler = require 'signaler'
  s = new Signaler
  s.on 'hello', (name) ->
    console.log "Hello #{name}"
  s.trigger 'hello', 'John'

If you want to get event notification 'max'-times. Use

  s.onmax 'hello', 5, (name) -> 
    console.log "Hello #{name}"

You can use signaler as a 'latch' with set-method. For example:

  s.on 'start', () -> console.log 'started 1'
  s.set 'start'
  s.on 'start', () -> console.log 'started notified here also'