expose .on and .emit after initialization
yoshuawuyts opened this issue · comments
Yosh commented
not recommending to do things dynamically, but being able to pass around an instance is neat.
Yosh commented
Removes the need for a large up-front object of requirements
Yosh commented
possibly leverage the .on('foo:bar:bin:baz', () =>)
shiz; or just .on('foo:bar', () =>)
Yosh commented
const barracks = require('barracks')
const d = barracks()
d.on('courses:get', () => console.log('whoop!')
d.on('courses:post', (ev, data, wait) => wait(['foobar', 'binbaz']))
d('courses:post', {my: 'data'})
Yosh commented
- remove payload delegation (only direct passing of stuff)
- remove dependance on
this
- next should be optional
- waitFor === next
Yosh commented
could also turn wait
into an object with yieldable values. E.g. going the co
route
Yosh commented
Or just make wait
return a Promise, so it can be yielded through Babel. Mwhehhhhh
Yosh commented
Should also be infinitely nestable, like with wayfarer
.
Yosh commented
We should probably leverage mounting semantics as outlined in choojs/wayfarer#12, making this the data transport counterpart to wayfarer
.