A class for creating a simple pub/sub radio.
Based on the API of Backbone.Radio
import SimpleRadio from 'simple-radio';
const radio = new SimpleRadio();
Make a request for name
. Optionally pass data. Returns reply if defined. Otherwise returns undefined
.
Respond to a request for name
. Callback function receives data
from request as parameter.
Return value is passed back to request.
Same as above but removes reply after one reply.
Removes reply handler for specified name.
Add callback for when name
is emitted.
Removes specified callback.
Emits name
with optional data
.
Removes all reply and emit handlers.