Skip to content

Commit

Permalink
feat: expose all debug prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Feb 9, 2018
1 parent c48e074 commit 7ba7396
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/debug/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import createBroadcaster from './createBroadcaster';
import {sym} from '../util';

const broadcaster = createBroadcaster();
const $$channelName = sym('debug' + (process.env.FREESTYLER_PREFIX ? '/' + process.env.FREESTYLER_PREFIX : ''));
const $$debug = sym('debug');
const channel = process.env.FREESTYLER_PREFIX || 'default';

window[$$channelName] = broadcaster;
if (!window[$$debug]) {
window[$$debug] = {};
}

export const emit = action => broadcaster.emit(action);

const FreestylerEmitter = require('../../../kuker-emitters/lib/FreestylerEmitter');
window[$$debug][channel] = broadcaster;

FreestylerEmitter();
export const emit = action => broadcaster.emit(action);

0 comments on commit 7ba7396

Please sign in to comment.