Improve type checks

This commit is contained in:
riggraz
2019-09-26 16:03:41 +02:00
parent 322c8e51cf
commit 678d2eaacf
16 changed files with 67 additions and 26 deletions

View File

@@ -28,7 +28,7 @@ export type CommentSubmitActionTypes =
CommentSubmitSuccessAction |
CommentSubmitFailureAction;
const commentSubmitStart = (parentId): CommentSubmitStartAction => ({
const commentSubmitStart = (parentId: number): CommentSubmitStartAction => ({
type: COMMENT_SUBMIT_START,
parentId,
});
@@ -40,17 +40,17 @@ const commentSubmitSuccess = (
comment: commentJSON,
});
const commentSubmitFailure = (parentId, error): CommentSubmitFailureAction => ({
const commentSubmitFailure = (parentId: number, error: string): CommentSubmitFailureAction => ({
type: COMMENT_SUBMIT_FAILURE,
parentId,
error,
});
export const submitComment = (
postId,
body,
parentId,
authenticityToken,
postId: number,
body: string,
parentId: number,
authenticityToken: string,
): ThunkAction<void, State, null, Action<string>> => async (dispatch) => {
dispatch(commentSubmitStart(parentId));