From 4ce4c74fd9851804a455a9dc95224bbb633366b2 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Wed, 19 Apr 2017 01:09:59 +0700 Subject: [PATCH] Return a value for notification actions --- client/coral-framework/actions/notification.js | 3 +++ client/coral-framework/constants/notification.js | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 client/coral-framework/constants/notification.js diff --git a/client/coral-framework/actions/notification.js b/client/coral-framework/actions/notification.js index 37679972d..d77a3a16c 100644 --- a/client/coral-framework/actions/notification.js +++ b/client/coral-framework/actions/notification.js @@ -1,9 +1,12 @@ import pym from '../services/PymConnection'; +import * as actions from '../constants/notification'; export const addNotification = (notifType, text) => { pym.sendMessage('coral-alert', `${notifType}|${text}`); + return {type: actions.ADD_NOTIFICATION, notifType, text}; }; export const clearNotification = () => { pym.sendMessage('coral-clear-notification'); + return {type: actions.CLEAR_NOTIFICATION}; }; diff --git a/client/coral-framework/constants/notification.js b/client/coral-framework/constants/notification.js new file mode 100644 index 000000000..a7334119a --- /dev/null +++ b/client/coral-framework/constants/notification.js @@ -0,0 +1,2 @@ +export const ADD_NOTIFICATION = 'ADD_NOTIFICATION'; +export const CLEAR_NOTIFICATION = 'CLEAR_NOTIFICATION';