Skip to content

Commit

Permalink
Add logger
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Apr 3, 2024
1 parent f86a59c commit f68a04c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/core/src/actions/spawnChild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ interface SpawnActionOptions<
| Mapper<TContext, TEvent, InputFrom<TActor['logic']>, TEvent>
| InputFrom<TActor['logic']>;
syncSnapshot?: boolean;
logger?: (...args: any[]) => void;
}

type DistributeActors<
Expand Down Expand Up @@ -170,6 +171,7 @@ type SpawnArguments<
systemId?: string;
input?: unknown;
syncSnapshot?: boolean;
logger?: (...args: any[]) => void;
}
];

Expand All @@ -182,7 +184,7 @@ export function spawnChild<
>(
...[
src,
{ id, systemId, input, syncSnapshot = false } = {} as any
{ id, systemId, input, syncSnapshot = false, logger } = {} as any
]: SpawnArguments<TContext, TExpressionEvent, TEvent, TActor>
): ActionFunction<
TContext,
Expand Down Expand Up @@ -210,6 +212,7 @@ export function spawnChild<
spawnChild.src = src;
spawnChild.input = input;
spawnChild.syncSnapshot = syncSnapshot;
spawnChild.logger = logger;

spawnChild.resolve = resolveSpawn;
spawnChild.execute = executeSpawn;
Expand Down

0 comments on commit f68a04c

Please sign in to comment.