verdnatura-chat/app/actions/usersTyping.ts

30 lines
587 B
TypeScript
Raw Normal View History

2022-02-28 18:00:47 +00:00
import { Action } from 'redux';
import { USERS_TYPING } from './actionsTypes';
export interface IUsersTypingGenericAction extends Action {
username: string;
}
export type TActionUserTyping = IUsersTypingGenericAction & Action;
export function addUserTyping(username: string): IUsersTypingGenericAction {
return {
type: USERS_TYPING.ADD,
username
};
}
export function removeUserTyping(username: string): IUsersTypingGenericAction {
return {
type: USERS_TYPING.REMOVE,
username
};
}
export function clearUserTyping(): Action {
return {
type: USERS_TYPING.CLEAR
};
}