From cf2b6bfe2f1f198eb0e310aa5110274e1c65570a Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 2 Apr 2018 18:02:09 -0700 Subject: [PATCH] refactor --- routes/_actions/addStatusOrNotification.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routes/_actions/addStatusOrNotification.js b/routes/_actions/addStatusOrNotification.js index e22de40..70eec62 100644 --- a/routes/_actions/addStatusOrNotification.js +++ b/routes/_actions/addStatusOrNotification.js @@ -7,6 +7,8 @@ import uniqBy from 'lodash/uniqBy' import uniq from 'lodash/uniq' import { isMobile } from '../_utils/isMobile' +const STREAMING_THROTTLE_DELAY = 3000 + function getExistingItemIdsSet (instanceName, timelineName) { let timelineItemIds = store.getForTimeline(instanceName, timelineName, 'timelineItemIds') || [] return new Set(timelineItemIds) @@ -75,7 +77,7 @@ const lazilyProcessFreshUpdates = throttle((instanceName, timelineName) => { runTask(() => { /* no await */ processFreshUpdates(instanceName, timelineName) }) -}, 3000) +}, STREAMING_THROTTLE_DELAY) export function addStatusOrNotification (instanceName, timelineName, newStatusOrNotification) { addStatusesOrNotifications(instanceName, timelineName, [newStatusOrNotification])