Skip to content

Commit

Permalink
fix(eventcenter): add global var
Browse files Browse the repository at this point in the history
  • Loading branch information
fupengl committed Aug 17, 2021
1 parent 567ff04 commit 8207916
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/things/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import root from '../global';
import Event from './event';

const eventCenter = new Event();
const eventCenterKey = '__planjs_event_center__';
const eventCenter: Event = root[eventCenterKey] || (root[eventCenterKey] = new Event());

export { Event, eventCenter };

Expand Down

0 comments on commit 8207916

Please sign in to comment.