Skip to content

Commit

Permalink
Rename for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed May 21, 2024
1 parent 4417728 commit d70e050
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
20 changes: 10 additions & 10 deletions packages/core/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export function setup<
TEvent extends AnyEventObject, // TODO: consider using a stricter `EventObject` here
TActors extends Record<string, UnknownActorLogic> = {},
TChildrenMap extends Record<string, string> = {},
TActions extends Record<
TActionParams extends Record<
string,
ParameterizedObject['params'] | undefined
> = {},
Expand Down Expand Up @@ -153,13 +153,13 @@ export function setup<
: never;
};
actions?: {
[K in keyof TActions]: ActionFunction<
[K in keyof TActionParams]: ActionFunction<
TContext,
TEvent, // Expression event
TEvent,
TEvent,
TActions[K],
TActionParams[K],
ToProvidedActor<TChildrenMap, TActors>,
ToParameterizedObject<TActions>,
ToParameterizedObject<TActionParams>,
ToParameterizedObject<TGuards>,
TDelay,
TEmitted
Expand All @@ -177,7 +177,7 @@ export function setup<
[K in TDelay]: DelayConfig<
TContext,
TEvent,
ToParameterizedObject<TActions>['params'],
ToParameterizedObject<TActionParams>['params'],
TEvent
>;
};
Expand All @@ -189,7 +189,7 @@ export function setup<
TContext,
TEvent,
ToProvidedActor<TChildrenMap, TActors>,
ToParameterizedObject<TActions>,
ToParameterizedObject<TActionParams>,
ToParameterizedObject<TGuards>,
TDelay,
TTag,
Expand All @@ -201,7 +201,7 @@ export function setup<
TypegenDisabled,
TEvent,
ToProvidedActor<TChildrenMap, TActors>,
ToParameterizedObject<TActions>,
ToParameterizedObject<TActionParams>,
ToParameterizedObject<TGuards>,
TDelay,
TTag,
Expand All @@ -218,7 +218,7 @@ export function setup<
Record<string, AnyActorRef | undefined>
>,
ToProvidedActor<TChildrenMap, TActors>,
ToParameterizedObject<TActions>,
ToParameterizedObject<TActionParams>,
ToParameterizedObject<TGuards>,
TDelay,
ToStateValue<TConfig>,
Expand All @@ -231,7 +231,7 @@ export function setup<
TypegenDisabled,
TEvent,
ToProvidedActor<TChildrenMap, TActors>,
ToParameterizedObject<TActions>,
ToParameterizedObject<TActionParams>,
ToParameterizedObject<TGuards>,
TDelay,
TTag,
Expand Down
8 changes: 5 additions & 3 deletions packages/core/test/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3556,10 +3556,12 @@ describe('inline actions (prev. enqueueActions)', () => {
});
});

it('should be able to enqueue an inline custom action', () => {
it('should be able to execute an inline custom action', () => {
setup({
actions: (_, _params: any, x) => {
x.action(() => {});
actions: {
foo: (_, _params: any, x) => {
x.action(() => {});
}
}
});
});
Expand Down

0 comments on commit d70e050

Please sign in to comment.