Skip to content

Commit

Permalink
Merge pull request #18 from czue/named-exports
Browse files Browse the repository at this point in the history
[breaking change] Swtich to only named exports
  • Loading branch information
czue authored Dec 11, 2024
2 parents 9955049 + 145393f commit 3155916
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Add the following importmap to your page anywhere before you use the library:

```html
<script type="module">
import BlueskyComments from 'https://unpkg.com/[email protected]/dist/bluesky-comments.es.js';
import { BlueskyComments } from 'https://unpkg.com/[email protected]/dist/bluesky-comments.es.js';
document.addEventListener('DOMContentLoaded', function() {
const author = 'you.bsky.social';
if (author) {
Expand Down
4 changes: 1 addition & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CommentSection } from './CommentSection'
import { Filters } from './CommentFilters'
import type { CommentOptions } from './types'

const BlueskyComments = {
export const BlueskyComments = {
init: function(elementId: string, options: CommentOptions) {
const element = document.getElementById(elementId)
if (!element) return;
Expand All @@ -24,8 +24,6 @@ const BlueskyComments = {
}

// Support both module exports and window global
export default BlueskyComments;

// Add to window object for UMD builds
if (typeof window !== 'undefined') {
(window as any).BlueskyComments = BlueskyComments;
Expand Down

0 comments on commit 3155916

Please sign in to comment.