From cda756be96e0d3d138be7e09fc4621655533a925 Mon Sep 17 00:00:00 2001 From: GleidsonDaniel Date: Mon, 17 Jan 2022 18:48:56 -0300 Subject: [PATCH] chore: migrate messages action to typescript --- app/actions/messages.js | 8 -------- app/actions/messages.ts | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 app/actions/messages.js create mode 100644 app/actions/messages.ts diff --git a/app/actions/messages.js b/app/actions/messages.js deleted file mode 100644 index 9f40809c..00000000 --- a/app/actions/messages.js +++ /dev/null @@ -1,8 +0,0 @@ -import * as types from './actionsTypes'; - -export function replyBroadcast(message) { - return { - type: types.MESSAGES.REPLY_BROADCAST, - message - }; -} diff --git a/app/actions/messages.ts b/app/actions/messages.ts new file mode 100644 index 00000000..eb0383ab --- /dev/null +++ b/app/actions/messages.ts @@ -0,0 +1,16 @@ +import { Action } from 'redux'; + +import { MESSAGES } from './actionsTypes'; + +type IMessage = Record; + +interface IReplyBroadcast extends Action { + message: IMessage; +} + +export function replyBroadcast(message: IMessage): IReplyBroadcast { + return { + type: MESSAGES.REPLY_BROADCAST, + message + }; +}