Improvment in tslint standard (#16)

This commit is contained in:
Qolzam
2017-10-10 16:39:02 +07:00
parent 181d2b8abd
commit 1937742f04
160 changed files with 984 additions and 1019 deletions

View File

@@ -1,4 +1,4 @@
import { Vote } from "domain/votes";
import { Vote } from 'domain/votes'
/**
* Vote state
@@ -14,7 +14,7 @@ export class VoteState {
* @type {({[postId: string]: {[voteId: string]: Vote}} | null)}
* @memberof VoteState
*/
postVotes: {[postId: string]: {[voteId: string]: Vote}} | null = null;
postVotes: {[postId: string]: {[voteId: string]: Vote}} | null = null
/**
* If posts vote are loaded {true} or not {false}
@@ -22,5 +22,5 @@ export class VoteState {
* @type {Boolean}
* @memberof VoteState
*/
loaded: Boolean = false;
loaded: Boolean = false
}

View File

@@ -1,3 +1,3 @@
import { voteReducer } from "./voteReducer";
import { voteReducer } from './voteReducer'
export {voteReducer};
export {voteReducer}

View File

@@ -6,11 +6,11 @@ import _ from 'lodash'
import {VoteActionType} from 'constants/voteActionType'
// Import domain
import { Vote } from "domain/votes";
import { Vote } from 'domain/votes'
import { VoteState } from "./VoteState";
import { IVoteAction } from "./IVoteAction";
import { VoteState } from './VoteState'
import { IVoteAction } from './IVoteAction'
/**
@@ -18,8 +18,8 @@ import { IVoteAction } from "./IVoteAction";
* @param {object} state
* @param {object} action
*/
export var voteReducer = (state: VoteState = new VoteState(), action: IVoteAction) => {
var { payload } = action
export let voteReducer = (state: VoteState = new VoteState(), action: IVoteAction) => {
let { payload } = action
switch (action.type) {
/* _____________ CRUD _____________ */
@@ -47,7 +47,7 @@ export var voteReducer = (state: VoteState = new VoteState(), action: IVoteActio
}
case VoteActionType.DELETE_VOTE:
var parsedVotes = {}
let parsedVotes = {}
if (state.postVotes![payload.postId])
Object.keys(state.postVotes![payload.postId]).map((id) => {
if (id !== payload.id) {
@@ -67,11 +67,11 @@ export var voteReducer = (state: VoteState = new VoteState(), action: IVoteActio
case VoteActionType.CLEAR_ALL_DATA_VOTE:
return new VoteState();
return new VoteState()
default:
return state;
return state
}