1.0.1 • Published 8 years ago

event-batcher v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

event-batcher

demo: http://benjaminbenben.com/event-batcher/examples/mouse.html

This gathers events and broadcasts them in batches with relative timestamps, allowing them to be unpacked and replayed in a smooth way.

var encode = eventBatcher.encode(100)
var decode = eventBatcher.decode()

// handle a batch of events
encode.handle(b => {
  // this will only get called every 100ms
  // this is where you might trigger an
  // event with pusher
  decode(batch)
})


addEventListener('mousemove', e => encode(e.clientX) )

decode.handle( x => console.log(x) )
1.0.1

8 years ago

1.0.0

8 years ago