0.1.2 • Published 11 years ago

choke v0.1.2

Weekly downloads
3
License
-
Repository
github
Last release
11 years ago

choke

Event throttle with hook for cancelling

Example

var choke = require("choke")
var EventSource = require("eventsource-reconnect")

var source = new EventSource("http://localhost:1234/events")

var reconnect = choke(source.reconnect, 15000)

source.onopen = reconnect.cancel    // kill any outstanding reconnect attempts
source.onclose = reconnect.listener // throttle reconnects to 15 seconds

Installation

npm install choke

Contributors

  • Matt-Esch

MIT Licenced