Skip to content

Commit

Permalink
Fix usage withing prerendered SPA (#1438)
Browse files Browse the repository at this point in the history
Make sure not to crash on the absence of a window object
  • Loading branch information
GrimaceOfDespair authored and marjan-georgiev committed Jul 29, 2018
1 parent 8ebba96 commit 261b438
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/events.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
declare let global: any;

/* tslint:disable:variable-name */
export const MouseEvent = ((window as any) || (global as any)).MouseEvent as MouseEvent;
export const KeyboardEvent = ((window as any) || (global as any)).KeyboardEvent as KeyboardEvent;
export const Event = ((window as any) || (global as any)).Event as Event;
export const MouseEvent = (((typeof window !== 'undefined' && window) as any) || (global as any)).MouseEvent as MouseEvent;
export const KeyboardEvent = (((typeof window !== 'undefined' && window) as any) || (global as any)).KeyboardEvent as KeyboardEvent;
export const Event = (((typeof window !== 'undefined' && window) as any) || (global as any)).Event as Event;

0 comments on commit 261b438

Please sign in to comment.