Skip to content

Commit

Permalink
feat: document how to import sse.js from a non-module context (closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetazzoni committed Jul 31, 2024
1 parent 0bfb307 commit 1f6d5e2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ EventSource = SSE;

## Usage

### Import

From a module context:

```js
import { SSE } from './sse.js';
```

From a non-module context:

```js
(async () => {
const { SSE } = import('./sse.js');
window.SSE = SSE;
})();
```

### Constructor

```js
Expand Down

0 comments on commit 1f6d5e2

Please sign in to comment.