Skip to content

Commit

Permalink
refactor(Store): rename payload to props
Browse files Browse the repository at this point in the history
  • Loading branch information
tja4472 committed Mar 9, 2019
1 parent 507176b commit 7d0a5ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/store/src/action_creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export function createAction<
P extends {
[key: string]: any;
}
>(type: T, payload: P): Action<T, P>;
>(type: T, props: P): Action<T, P>;
export function createAction<
T extends string,
P extends {
[key: string]: any;
}
>(type: T, payload?: P) {
>(type: T, props?: P) {
/*
The following line requires Typescript 3.2: Generic spread expressions in
object literals.
Expand All @@ -28,7 +28,7 @@ export function createAction<
*/
// const action = payload === undefined ?{ type } : { type, ...payload };
const action =
payload === undefined ? { type } : { type, ...(payload as object) };
props === undefined ? { type } : { type, ...(props as object) };
return action;
}

Expand Down

0 comments on commit 7d0a5ac

Please sign in to comment.