Skip to content

Commit

Permalink
Drop default exports
Browse files Browse the repository at this point in the history
  • Loading branch information
willeastcott committed Jun 17, 2024
1 parent d0d2b70 commit 6d27cab
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 19 deletions.
20 changes: 19 additions & 1 deletion src/event-handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@
* event management and chaining.
*/
class EventHandle {
/**
* @type {import('./events.js').Events}
* @private
*/
owner;

/**
* @type {string}
* @private
*/
name;

/**
* @type {import('./events.js').HandleEvent}
* @private
*/
fn;

/**
* Creates an instance of EventHandle.
*
Expand Down Expand Up @@ -58,4 +76,4 @@ class EventHandle {
}
}

export default EventHandle;
export { EventHandle };
4 changes: 2 additions & 2 deletions src/events.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EventHandle from './event-handle.js';
import { EventHandle } from './event-handle.js';

/**
* @callback HandleEvent
Expand Down Expand Up @@ -269,4 +269,4 @@ class Events {
}
}

export default Events;
export { Events };
4 changes: 2 additions & 2 deletions src/history.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Events from './events.js';
import { Events } from './events.js';

/**
* @typedef {object} HistoryAction
Expand Down Expand Up @@ -288,4 +288,4 @@ class History extends Events {
}
}

export default History;
export { History };
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* @module Observer
*/

import EventHandle from './event-handle.js';
import Events from './events.js';
import History from './history.js';
import Observer from './observer.js';
import ObserverHistory from './observer-history.js';
import ObserverList from './observer-list.js';
import { EventHandle } from './event-handle.js';
import { Events } from './events.js';
import { History } from './history.js';
import { Observer } from './observer.js';
import { ObserverHistory } from './observer-history.js';
import { ObserverList } from './observer-list.js';

export {
EventHandle,
Expand Down
6 changes: 3 additions & 3 deletions src/observer-history.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Events from './events.js';
import Observer from './observer.js';
import { Events } from './events.js';
import { Observer } from './observer.js';

/**
* History for an observer.
Expand Down Expand Up @@ -240,4 +240,4 @@ class ObserverHistory extends Events {
}
}

export default ObserverHistory;
export { ObserverHistory };
6 changes: 3 additions & 3 deletions src/observer-list.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Events from './events.js';
import Observer from './observer.js';
import { Events } from './events.js';
import { Observer } from './observer.js';

/**
* A list of observers.
Expand Down Expand Up @@ -300,4 +300,4 @@ class ObserverList extends Events {
}
}

export default ObserverList;
export { ObserverList };
4 changes: 2 additions & 2 deletions src/observer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Events from './events.js';
import { Events } from './events.js';
import { arrayEquals } from './utils.js';

/**
Expand Down Expand Up @@ -986,4 +986,4 @@ class Observer extends Events {
}
}

export default Observer;
export { Observer };

0 comments on commit 6d27cab

Please sign in to comment.