Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
21e8 committed Dec 7, 2024
1 parent ccfd601 commit 541b120
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/batcher.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MessageBatcher } from '../batcher';
import { createMessageBatcher } from '../batcher';
import type { Message, MessageProcessor } from '../types';

describe('MessageBatcher', () => {
Expand All @@ -16,7 +16,7 @@ describe('MessageBatcher', () => {
processBatch: processBatchMock,
};

const batcher = MessageBatcher.create([mockProcessor], {
const batcher = createMessageBatcher([mockProcessor], {
maxBatchSize: 3,
maxWaitMs: 1000,
});
Expand Down
9 changes: 0 additions & 9 deletions src/batcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,4 @@ export function createMessageBatcher(
};
}

// Add a class wrapper for compatibility
export class MessageBatcher {
static create(
processors: MessageProcessor[],
config: Required<BatcherConfig>
): IMessageBatcher {
return createMessageBatcher(processors, config);
}
}

2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type { EmailConfig } from './processors/email';

export { ConsoleProcessor } from './processors/console';

export { createMessageBatcher, MessageBatcher } from './batcher';
export { createMessageBatcher } from './batcher';
export type {
Message,
BatcherConfig,
Expand Down

0 comments on commit 541b120

Please sign in to comment.