From d4e00576dc950e060a210ed23e4d67ec1baeaf1a Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 30 Sep 2016 00:51:40 -0400 Subject: [PATCH] bugfix --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 42ed4ec..b613609 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,8 @@ module.exports.create = function (opts) { if (!opts.onMessage && !opts.onmessage) { machine = new (require('events').EventEmitter)(); + } else { + machine = {}; } machine.onMessage = opts.onmessage || opts.onMessage;