Skip to content

Commit

Permalink
Merge pull request huzidaha#3 from jacklee814/patch-2
Browse files Browse the repository at this point in the history
Update comments.js
  • Loading branch information
huzidaha authored Mar 14, 2018
2 parents 4c82953 + c37ca7b commit 0d0a3fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions comment-app3/src/reducers/comments.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// action types
const INIT_COMMNETS = 'INIT_COMMNETS'
const INIT_COMMENTS = 'INIT_COMMENTS'
const ADD_COMMENT = 'ADD_COMMENT'
const DELETE_COMMENT = 'DELETE_COMMENT'

Expand All @@ -9,7 +9,7 @@ export default function (state, action) {
state = { comments: [] }
}
switch (action.type) {
case INIT_COMMNETS:
case INIT_COMMENTS:
// 初始化评论
return { comments: action.comments }
case ADD_COMMENT:
Expand All @@ -32,7 +32,7 @@ export default function (state, action) {

// action creators
export const initComments = (comments) => {
return { type: INIT_COMMNETS, comments }
return { type: INIT_COMMENTS, comments }
}

export const addComment = (comment) => {
Expand Down

0 comments on commit 0d0a3fe

Please sign in to comment.