Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
significantly reduce tabUpdated calls
Browse files Browse the repository at this point in the history
auditors @bbondy
  • Loading branch information
bridiver committed Feb 17, 2017
1 parent e0fc770 commit c7f3cbd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/browser/tabs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const appActions = require('../../js/actions/appActions')
const messages = require('../..//js/constants/messages')
const debounce = require('../../js/lib/debounce')
const messages = require('../../js/constants/messages')
const Immutable = require('immutable')
const tabState = require('../common/state/tabState')
const {app, extensions} = require('electron')
Expand All @@ -26,11 +27,13 @@ const getTabValue = function (tabId) {
}
}

const tabUpdated = debounce(appActions.tabUpdated.bind(appActions), 5)

const updateTab = (tabId) => {
let tabValue = getTabValue(tabId)
if (tabValue) {
setImmediate(() => {
appActions.tabUpdated(tabValue)
tabUpdated(tabValue)
})
}
}
Expand Down

0 comments on commit c7f3cbd

Please sign in to comment.