Skip to content
Eric M. Dantas edited this page Aug 19, 2016 · 2 revisions

Do I have to stringify the info to be passed around?

Nope, you can use any type of data you want. Boolean, String, Object, even functions!

Say I called bus.emit('ev', {a: true}), the object being passed is cloned or it's the same object?

As of right now, it's the same object, there's no cloning involved.

Can I call bus.emit('ev', info) without the info param?

Yes, there'll be times where only notifying will be enough, there's no need to pass null, undefined or {} just to fullfil the contract and make things work.

Can I use μBus in the server?

I mean, you can, we've got a bunch of different builds (check the dist folder) to help you do that, but since Node already has the EventEmitter which has a pretty straight forward API too, you should stick to that.

See https://nodejs.org/api/events.html#events_class_eventemitter for more info.