Skip to content

Commit

Permalink
Expose EventEmitter class on BaseClient to be used by plugins
Browse files Browse the repository at this point in the history
Plugins can't import EventEmitter class directly as that would increase
the bundle size of a plugin
  • Loading branch information
VeskeR committed Oct 16, 2024
1 parent 5e5170c commit 2f3bcf8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/common/lib/client/baseclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { MsgPack } from 'common/types/msgpack';
import { HTTPRequestImplementations } from 'platform/web/lib/http/http';
import { FilteredSubscriptions } from './filteredsubscriptions';
import type { LocalDevice } from 'plugins/push/pushactivation';
import EventEmitter from '../util/eventemitter';

type BatchResult<T> = API.BatchResult<T>;
type BatchPublishSpec = API.BatchPublishSpec;
Expand Down Expand Up @@ -179,6 +180,7 @@ class BaseClient {
Logger = Logger;
Defaults = Defaults;
Utils = Utils;
EventEmitter = EventEmitter;
}

export default BaseClient;
4 changes: 2 additions & 2 deletions src/common/lib/client/modularplugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
fromValuesArray as presenceMessagesFromValuesArray,
} from '../types/presencemessage';
import { TransportCtor } from '../transport/transport';
import * as PushPlugin from 'plugins/push';
import * as LiveObjectsPlugin from 'plugins/liveobjects';
import type * as PushPlugin from 'plugins/push';
import type * as LiveObjectsPlugin from 'plugins/liveobjects';

export interface PresenceMessagePlugin {
presenceMessageFromValues: typeof presenceMessageFromValues;
Expand Down

0 comments on commit 2f3bcf8

Please sign in to comment.