From 99d79eee56a1b5a27f18fffd90545b4aef191bba Mon Sep 17 00:00:00 2001 From: Florian Orben Date: Fri, 4 Dec 2015 20:18:49 +0100 Subject: add helper method to add ephemeral messages; also switch 'delete message' to this new method --- web/react/utils/utils.jsx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'web/react/utils/utils.jsx') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index c2e4276b0..13c7f961a 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -1254,3 +1254,8 @@ export function isFeatureEnabled(feature) { export function isSystemMessage(post) { return post.type && (post.type.lastIndexOf(Constants.SYSTEM_MESSAGE_PREFIX) === 0); } + +// convenience method to dispatch an event in JS' next event cycle +export function defer(fn) { + setTimeout(fn, 0); +} -- cgit v1.2.3-1-g7c22