Skip to content

Commit

Permalink
docs: fixed example for universal usage
Browse files Browse the repository at this point in the history
If we do not set `typeof window === 'undefined'`, then an uncaught exception occurs Node side.
  • Loading branch information
niftylettuce committed Jun 17, 2019
1 parent 29890fb commit f8c9f4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ You can use a really simple pattern to enable your browser modules to run in Nod

```js
function createTitle(text, win) {
win = win || window;
win = win || (typeof window === 'undefined' ? undefined : window);

const title = win.document.createElement('h1');
title.innerHTML = text;
Expand Down

0 comments on commit f8c9f4a

Please sign in to comment.