diff --git a/src/__tests__/batcher.test.ts b/src/__tests__/batcher.test.ts index b3a0653..a04fecf 100644 --- a/src/__tests__/batcher.test.ts +++ b/src/__tests__/batcher.test.ts @@ -1,4 +1,4 @@ -import { MessageBatcher } from '../batcher'; +import { createMessageBatcher } from '../batcher'; import type { Message, MessageProcessor } from '../types'; describe('MessageBatcher', () => { @@ -16,7 +16,7 @@ describe('MessageBatcher', () => { processBatch: processBatchMock, }; - const batcher = MessageBatcher.create([mockProcessor], { + const batcher = createMessageBatcher([mockProcessor], { maxBatchSize: 3, maxWaitMs: 1000, }); diff --git a/src/batcher.ts b/src/batcher.ts index b817e4b..e4632b3 100644 --- a/src/batcher.ts +++ b/src/batcher.ts @@ -98,13 +98,4 @@ export function createMessageBatcher( }; } -// Add a class wrapper for compatibility -export class MessageBatcher { - static create( - processors: MessageProcessor[], - config: Required - ): IMessageBatcher { - return createMessageBatcher(processors, config); - } -} diff --git a/src/index.ts b/src/index.ts index 7d1c46d..abb9942 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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,