function getResult(...) { // ... } var payment = getResult({...}); // Calculate the payment for given loan terms. function getPayment(...) { // ... } var payment = getPayment({...}); // Calculate the payment for given loan terms. function paymentFor(...) { // ... } var payment = paymentFor({...}); better better OK
// 5 mins var lastUITouch = Date.now(); // Start the fetching. var timer = setInterval(function() { fetchViewerCount({ onLoad: updateViewerCount }); }, 1000); // Update the number of viewers watching. function updateViewerCount(num) { if ((Date.now() - lastUITouch) < timeoutThresholdMs) { viewerCountLabel.value = num; } else { alert(‘You are being logged out.’); clearInterval(timer); loginWindow.open(); activeWindow.close(); } }
// 5 mins var lastUITouch = Date.now(); // Start the fetching. var timer = setInterval(function() { fetchViewerCount({ onLoad: updateViewerCount }); }, 1000); // Update the number of viewers watching. function updateViewerCount(num) { if ((Date.now() - lastUITouch) < timeoutThreshouldMs) { viewerCountLabel.value = num; } else { alert(‘You are being logged out.’); clearInterval(timer); loginWindow.open(); activeWindow.close(); } }
viewerCountFetcher.start() { onLoad: updateViewerCount }; } function logout() { viewerCountFetcher.stop(); session.end(); loginWindow.open(); activeWindow.close(); } // Update the number of viewers watching. function updateViewerCount(num) { if (session.isLive()) { viewerCountLabel.value = num; } else { alert(‘Session expired, you will be logged out.’); logout(); } }
viewerCountFetcher.start() { onLoad: updateViewerCount }; } function logout() { viewerCountFetcher.stop(); session.end(); loginWindow.open(); activeWindow.close(); } // Update the number of viewers watching. function updateViewerCount(num) { if (session.isLive()) { viewerCountLabel.value = num; } else { alert(‘Session expired, you will be logged out.’); logout(); } }
session & fetch loginWindow.close(); } function logout() { loginWindow.open(); activeWindow.close(); // Stops session & fetch } // Update the number of viewers watching. function updateViewerCount(num) { if (session.isLive()) { viewerCountLabel.value = num; } else { alert(‘Session expired, you will be logged out.’); logout(); } }
// Attempt to transition states. if (stateMachine.handleEvent(eventName)) { // Delegate execution to the state object. stateMachine.currentState.execute(); } }