An event bus and helpers
$ npm install @nichoth/events
This inherits from nanobus, and has the same API, except for the constructor, which takes a list of valid event names, and the
emit method, which will return a curried function if you don't pass in a second argument.
Pass in a list of event names when you create a bus, then throw an error if you subscribe to an event that's not in the list. If you don't pass in any event names, then you can subscribe to anything.
var test =var Bus =var bus =
Return a curried function if you don't pass in a second argument.
Recursively namespace an object of event names
var namespace =var test =var input =events:update: 'get' 'add' 'delete' 'edit'foo:bar:baz: 'a' 'b' 'c'var expected =events:update:get: 'events.update.get'add: 'events.update.add'delete: 'events.update.delete'edit: 'events.update.edit'foo:bar:baz:a: 'foo.bar.baz.a'b: 'foo.bar.baz.b'c: 'foo.bar.baz.c'
Take an object of strings and return an array of the leaf nodes. The object can be any depth.
var flatten =var test =
Take an object of async functions and emit events on the given bus
var HttpEffects =var Bus =var test =