chore: update interfaces and types names
This commit is contained in:
parent
c471195d8c
commit
48e4640bee
|
@ -3,13 +3,13 @@ import { Action } from 'redux';
|
||||||
import { IActiveUsers } from '../reducers/activeUsers';
|
import { IActiveUsers } from '../reducers/activeUsers';
|
||||||
import { SET_ACTIVE_USERS } from './actionsTypes';
|
import { SET_ACTIVE_USERS } from './actionsTypes';
|
||||||
|
|
||||||
export interface SetActiveUsers extends Action {
|
export interface ISetActiveUsers extends Action {
|
||||||
activeUsers: IActiveUsers;
|
activeUsers: IActiveUsers;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type IActionActiveUsers = SetActiveUsers;
|
export type TActionActiveUsers = ISetActiveUsers;
|
||||||
|
|
||||||
export const setActiveUsers = (activeUsers: IActiveUsers): SetActiveUsers => ({
|
export const setActiveUsers = (activeUsers: IActiveUsers): ISetActiveUsers => ({
|
||||||
type: SET_ACTIVE_USERS,
|
type: SET_ACTIVE_USERS,
|
||||||
activeUsers
|
activeUsers
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,17 +3,17 @@ import { Action } from 'redux';
|
||||||
import { ISelectedUser } from '../reducers/selectedUsers';
|
import { ISelectedUser } from '../reducers/selectedUsers';
|
||||||
import * as types from './actionsTypes';
|
import * as types from './actionsTypes';
|
||||||
|
|
||||||
type User = {
|
type TUser = {
|
||||||
user: ISelectedUser;
|
user: ISelectedUser;
|
||||||
};
|
};
|
||||||
|
|
||||||
type IAction = Action & User;
|
type IAction = Action & TUser;
|
||||||
|
|
||||||
interface SetLoading extends Action {
|
interface ISetLoading extends Action {
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type IActionSelectedUsers = IAction & SetLoading;
|
export type TActionSelectedUsers = IAction & ISetLoading;
|
||||||
|
|
||||||
export function addUser(user: ISelectedUser): IAction {
|
export function addUser(user: ISelectedUser): IAction {
|
||||||
return {
|
return {
|
||||||
|
@ -35,7 +35,7 @@ export function reset(): Action {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setLoading(loading: boolean): SetLoading {
|
export function setLoading(loading: boolean): ISetLoading {
|
||||||
return {
|
return {
|
||||||
type: types.SELECTED_USERS.SET_LOADING,
|
type: types.SELECTED_USERS.SET_LOADING,
|
||||||
loading
|
loading
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { IActionSelectedUsers } from '../../actions/selectedUsers';
|
import { TActionSelectedUsers } from '../../actions/selectedUsers';
|
||||||
import { IActionActiveUsers } from '../../actions/activeUsers';
|
import { TActionActiveUsers } from '../../actions/activeUsers';
|
||||||
// REDUCERS
|
// REDUCERS
|
||||||
import { IActiveUsers } from '../../reducers/activeUsers';
|
import { IActiveUsers } from '../../reducers/activeUsers';
|
||||||
import { ISelectedUsers } from '../../reducers/selectedUsers';
|
import { ISelectedUsers } from '../../reducers/selectedUsers';
|
||||||
|
@ -28,4 +28,4 @@ export interface ApplicationState {
|
||||||
roles: any;
|
roles: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ApplicationActions = IActionActiveUsers & IActionSelectedUsers;
|
export type ApplicationActions = TActionActiveUsers & TActionSelectedUsers;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import { ApplicationActions } from '../definitions';
|
import { ApplicationActions } from '../definitions';
|
||||||
import { SET_ACTIVE_USERS } from '../actions/actionsTypes';
|
import { SET_ACTIVE_USERS } from '../actions/actionsTypes';
|
||||||
|
|
||||||
type UserStatus = 'online' | 'offline';
|
type TUserStatus = 'online' | 'offline';
|
||||||
export interface ActiveUser {
|
export interface IActiveUser {
|
||||||
status: UserStatus;
|
status: TUserStatus;
|
||||||
statusText?: string;
|
statusText?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IActiveUsers {
|
export interface IActiveUsers {
|
||||||
[key: string]: ActiveUser;
|
[key: string]: IActiveUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const initialState: IActiveUsers = {};
|
export const initialState: IActiveUsers = {};
|
||||||
|
|
Loading…
Reference in New Issue