Improvment in tslint standard (#16)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
import { Comment } from "domain/comments";
|
||||
import { Comment } from 'domain/comments'
|
||||
|
||||
/**
|
||||
* Comment state
|
||||
@@ -15,7 +15,7 @@ export class CommentState {
|
||||
* @type {({[postId: string]: {[commentId: string]: Comment}} | null)}
|
||||
* @memberof CommentState
|
||||
*/
|
||||
postComments: {[postId: string]: {[commentId: string]: Comment}} = {};
|
||||
postComments: {[postId: string]: {[commentId: string]: Comment}} = {}
|
||||
|
||||
/**
|
||||
* If the comments are loaded {true} or not {false}
|
||||
@@ -23,5 +23,5 @@ export class CommentState {
|
||||
* @type {Boolean}
|
||||
* @memberof CommentState
|
||||
*/
|
||||
loaded: Boolean = false;
|
||||
loaded: Boolean = false
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import {CommentActionType} from 'constants/commentActionType'
|
||||
* @interface ICommentAction
|
||||
*/
|
||||
export interface ICommentAction {
|
||||
payload: any;
|
||||
type: CommentActionType;
|
||||
payload: any
|
||||
type: CommentActionType
|
||||
|
||||
}
|
||||
@@ -3,23 +3,23 @@ import moment from 'moment'
|
||||
import _ from 'lodash'
|
||||
|
||||
// - Import domain
|
||||
import { User } from "domain/users";
|
||||
import { Comment } from "domain/comments";
|
||||
import { User } from 'domain/users'
|
||||
import { Comment } from 'domain/comments'
|
||||
|
||||
// - Import action types
|
||||
import {CommentActionType} from 'constants/commentActionType'
|
||||
|
||||
|
||||
import { CommentState } from "./CommentState";
|
||||
import { ICommentAction } from "./ICommentAction";
|
||||
import { CommentState } from './CommentState'
|
||||
import { ICommentAction } from './ICommentAction'
|
||||
|
||||
/**
|
||||
* Comment reducer
|
||||
* @param state
|
||||
* @param action
|
||||
*/
|
||||
export var commentReducer = (state: CommentState = new CommentState(), action: ICommentAction) => {
|
||||
var { payload } = action
|
||||
export let commentReducer = (state: CommentState = new CommentState(), action: ICommentAction) => {
|
||||
let { payload } = action
|
||||
switch (action.type) {
|
||||
|
||||
/* _____________ CRUD _____________ */
|
||||
@@ -62,7 +62,7 @@ export var commentReducer = (state: CommentState = new CommentState(), action: I
|
||||
}
|
||||
}
|
||||
case CommentActionType.DELETE_COMMENT:
|
||||
var parsedComments = {}
|
||||
let parsedComments = {}
|
||||
if (!state.postComments![payload.postId]) {
|
||||
return state
|
||||
}
|
||||
@@ -111,11 +111,11 @@ export var commentReducer = (state: CommentState = new CommentState(), action: I
|
||||
}
|
||||
|
||||
case CommentActionType.CLEAR_ALL_DATA_COMMENT:
|
||||
return new CommentState();
|
||||
return new CommentState()
|
||||
|
||||
|
||||
default:
|
||||
return state;
|
||||
return state
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import { commentReducer } from "./commentReducer";
|
||||
import { commentReducer } from './commentReducer'
|
||||
|
||||
export {commentReducer};
|
||||
export {commentReducer}
|
||||
Reference in New Issue
Block a user