Skip to content

Commit

Permalink
Resolved and rejected actions have now typed payload
Browse files Browse the repository at this point in the history
  • Loading branch information
teneko committed Nov 1, 2021
1 parent fabd42c commit bdc0104
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
23 changes: 11 additions & 12 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
end_of_line = crlf
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = true
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = true
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function* rejectPromiseAction<TA extends PayloadActionAndMeta<any, any, a
function createPromiseActions<V, T extends string>(type: T) {
return {
resolvedAction: createAction<V>(`${type}/resolved`),
rejectedAction: createAction(`${type}/rejected`),
rejectedAction: createAction<any>(`${type}/rejected`),
};
}

Expand All @@ -113,7 +113,7 @@ function createUpdatedTrigger<V, P, T extends string, TA extends PayloadActionCr
type: T,
triggerAction: TA,
) {
const { resolvedAction, rejectedAction } = createPromiseActions(type);
const { resolvedAction, rejectedAction } = createPromiseActions<V, T>(type);

const updatedTrigger = createAction(type, (...args: any[]) => merge(triggerAction.apply(null, args), {
meta: {
Expand Down

0 comments on commit bdc0104

Please sign in to comment.