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 { Notification } from "domain/notifications";
import { Notification } from 'domain/notifications'
/**
* Notification state
@@ -14,7 +14,7 @@ export class NotificationState {
* @type {({[userId: string]: {[notificationId: string]: Notification}} | null)}
* @memberof NotificationState
*/
userNotifies: {[userId: string]: {[notificationId: string]: Notification}} = {};
userNotifies: {[userId: string]: {[notificationId: string]: Notification}} = {}
/**
* If user notifications are loaded {true} or not {false}
@@ -22,5 +22,5 @@ export class NotificationState {
* @type {Boolean}
* @memberof NotificationState
*/
loaded: Boolean = false;
loaded: Boolean = false
}

View File

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

View File

@@ -3,13 +3,13 @@ import moment from 'moment'
import _ from 'lodash'
// - Import domain
import { Notification } from "domain/notifications";
import { Notification } from 'domain/notifications'
// - Import action types
import {NotificationActionType} from 'constants/notificationActionType'
import { NotificationState } from "./NotificationState";
import { INotificationAction } from "./INotificationAction";
import { NotificationState } from './NotificationState'
import { INotificationAction } from './INotificationAction'
/**
@@ -17,8 +17,8 @@ import { INotificationAction } from "./INotificationAction";
* @param {object} state
* @param {object} action
*/
export var notificationReducer = (state: NotificationState = new NotificationState(), action: INotificationAction) => {
var { payload } = action
export let notificationReducer = (state: NotificationState = new NotificationState(), action: INotificationAction) => {
let { payload } = action
switch (action.type) {
/* _____________ CRUD _____________ */
@@ -48,7 +48,7 @@ export var notificationReducer = (state: NotificationState = new NotificationSta
}
case NotificationActionType.DELETE_NOTIFY:
var parsedNotifies = {}
let parsedNotifies = {}
Object.keys(state.userNotifies!).map((id) => {
if (id !== payload) {
_.merge(parsedNotifies, { [id]: { ...state.userNotifies![id] } })
@@ -68,7 +68,7 @@ export var notificationReducer = (state: NotificationState = new NotificationSta
default:
return state;
return state
}