object-emitter-only
v1.0.0
Published
Proxy object values to only expose emitter methods.
Downloads
3
Readme
object-emitter-only
Proxy object values to only expose emitter methods. Normalizes objects based off
EventDispatcher
. Leverages event-accessor
and object-apply
to do the
transformation.
Installation
$ npm i --save object-emitter-only
Overview
var emitterProxy = require('object-emitter-only');
var Emitter = require('events').EventEmitter;
var impureObject = new Emitter();
impureObject.foo = 'strip me away!';
emitterProxy({
foo: new Emitter(),
bar: impureObject
});
// all values returned by `emitterProxy` now only expose `emitter` functions.