From d1435a137bb50c514de8a79fa0c80264dfbb9f35 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 14 Jun 2018 12:58:23 +0200 Subject: deploy bundle --- app/client/live/player.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'app/client/live') diff --git a/app/client/live/player.js b/app/client/live/player.js index 3fd33e8..2fafb5c 100644 --- a/app/client/live/player.js +++ b/app/client/live/player.js @@ -79,10 +79,8 @@ export function onFrame (data) { } let previousValue, currentValue -function handleChange() { - let previousValue = currentValue - currentValue = store.getState().live.playing - +export function toggleFPS(state) { + currentValue = typeof state !== 'undefined' ? state : store.getState().live.playing if (previousValue !== currentValue) { if (currentValue) { startWatchingFPS() @@ -90,11 +88,12 @@ function handleChange() { stopWatchingFPS() } } + previousValue = currentValue } let fpsInterval; -function startWatchingFPS(){ +export function startWatchingFPS(){ clearInterval(fpsInterval) fpsInterval = setInterval(() => { store.dispatch({ @@ -108,6 +107,6 @@ function startWatchingFPS(){ fps = 0 }, 1000) } -function stopWatchingFPS(){ +export function stopWatchingFPS(){ clearInterval(fpsInterval) } \ No newline at end of file -- cgit v1.2.3-70-g09d2