Skip to content

Commit b412e52

Browse files
committed
Address copilot review
1 parent af5326b commit b412e52

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

apps/docs/pages/api-reference/functions/createAction.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ allowing it to be used in reducer logic that is looking for that action type.
3434
**createAction**\<`PA`, `T`\>(`type`, `prepareAction`): `PayloadActionCreator`\<`ReturnType`\<`PA`\>[``"payload"``], `T`, `PA`\>
3535

3636
A utility function to create an action creator for the given action type
37-
string. The action creator accepts a single argument, which will be included
38-
in the action object as a field called payload. The action creator function
39-
will also have its toString() overridden so that it returns the action type,
37+
string. The action creator's parameters mirror the `prepareAction`
38+
function signature, and any arguments passed to the action creator are
39+
forwarded to `prepareAction`. The resulting payload is included in the
40+
action object as a field called `payload`. The action creator function will
41+
also have its toString() overridden so that it returns the action type,
4042
allowing it to be used in reducer logic that is looking for that action type.
4143

4244
#### Type parameters

packages/core/src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
export { createAction } from './action';
2+
export type {
3+
ActionCreatorWithNonInferrablePayload,
4+
ActionCreatorWithOptionalPayload,
5+
ActionCreatorWithPayload,
6+
ActionCreatorWithPreparedPayload,
7+
ActionCreatorWithoutPayload,
8+
PayloadAction,
9+
PayloadActionCreator,
10+
PrepareAction,
11+
} from './action';
212
export * from './event';
313
export * from './graph';
414
export * from './provenance';

0 commit comments

Comments
 (0)