eventuate-map
create a mapped eventuate
example
var eventuate = map = var pie = var addTopping = piepiepie
api
var eventuate = var map = var upstreamEventuate =
var mappedEventuate = map(upstreamEventuate, mapFunc)
Returns a new eventuate which produces mapped event payloads from eventuate upstreamEventuate
using mapFunc
. mapFunc
should have the signature function (data) { }
, and return the mapped payload. This function receives all event data from upstreamEventuate
.
If upstreamEventuate
is an unmonitored eventuate, filteredEventuate
will return an unmonitored eventuate.
mappedEventuate.unsubscribe()
Stop consuming events from upstreamEventuate
(and thus stop producing events).
mappedEventuate.upstreamConsumer
The function added as a consumer to the upstreamEventuate
. Example:
var consumerIdx = upstreamEventuateconsumers
install
With npm do:
npm install eventuate-map
testing
npm test [--dot | --spec] [--phantom] [--grep=pattern]
Specifying --dot
or --spec
will change the output from the default TAP style.
Specifying --phantom
will cause the tests to run in the headless phantom browser instead of node.
Specifying --grep
will only run the test files that match the given pattern.
browser test
npm run browser-test
This will run the tests in all browsers (specified in .zuul.yml). Be sure to educate zuul first.
coverage
npm run coverage [--html]
This will output a textual coverage report. Including --html
will also open
an HTML coverage report in the default browser.