From 0a07268a9f4da11208775c632a661ea8cb35a537 Mon Sep 17 00:00:00 2001 From: Daniel Jonathan Date: Mon, 1 Jan 2024 13:34:24 -0600 Subject: [PATCH] added var args to Aggregate --- package-lock.json | 4 ++-- package.json | 2 +- src/Aggregate.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc46427..e937a2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cosmicmind/domainjs", - "version": "0.0.1-rc-010124-4", + "version": "0.0.1-rc-010124-4-a", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cosmicmind/domainjs", - "version": "0.0.1-rc-010124-4", + "version": "0.0.1-rc-010124-4-a", "license": "UNLICENSED", "dependencies": { "@cosmicmind/foundationjs": "^0.0.1-rc-120723-1", diff --git a/package.json b/package.json index 0c809e2..b453390 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cosmicmind/domainjs", - "version": "0.0.1-rc-010124-4", + "version": "0.0.1-rc-010124-4-a", "description": "A domain-driven design framework for scalable systems.", "keywords": [], "author": { diff --git a/src/Aggregate.ts b/src/Aggregate.ts index 19b3c5a..99cf54a 100644 --- a/src/Aggregate.ts +++ b/src/Aggregate.ts @@ -58,7 +58,7 @@ export type AggregateTypeFor = A extends Aggregate ? E : A export type AggregateConstructor> = new (root: AggregateTypeFor, ...args: unknown[]) => A -export function defineAggregate>(_class: AggregateConstructor, handler: EntityLifecycle> = {}): (root: AggregateTypeFor) => A { +export function defineAggregate>(_class: AggregateConstructor, handler: EntityLifecycle> = {}): (root: AggregateTypeFor, ...args: unknown[]) => A { const createEntity = defineEntity>(handler) return (root: AggregateTypeFor, ...args: unknown[]): A => new _class(createEntity(root), ...args) } \ No newline at end of file