src/execute-js-func.js
function listenToIpc(channel) {
  return Observable.create((subj) => {
    let listener = (event, ...args) => {
      d(`Got an event for ${channel}: ${JSON.stringify(args)}`);
      subj.next(args);
    };

    d(`Setting up listener! ${channel}`);
    ipc.on(channel, listener);

    return new Subscription(() =>
      ipc.removeListener(channel, listener));
  });
}
function listenToIpc(channel) {
  return Observable.create((subj) => {
    let listener = (event, ...args) => {
      d(`Got an event for ${channel}: ${JSON.stringify(args)}`);
      subj.next(args);
    };

    d(`Setting up listener! ${channel}`);
    ipc.on(channel, listener);

    return new Subscription(() =>
      ipc.removeListener(channel, listener));
  });
}
Turns an IPC channel into an Observable

@param  {String} channel     The IPC channel to listen to via `ipc.on`

@return {Observable<Array>}  An Observable which sends IPC args via `onNext`

@private