Skip to content

Commit

Permalink
Do not warn about the number of subscribers to renderer store state c…
Browse files Browse the repository at this point in the history
…hange events

Fix brave#9643
  • Loading branch information
petemill committed Jan 29, 2018
1 parent ad4c3ed commit 5e072a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/stores/appStoreRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class AppStoreRenderer extends EventEmitter {
constructor () {
super()
this.appState = new Immutable.Map()
// Many components can subscribe to changes in store state
// so ignore any memory-leak warning about having more than 10 listeners.
this.setMaxListeners(0)
}
emitChanges () {
if (lastEmittedState !== this.appState) {
Expand Down
7 changes: 7 additions & 0 deletions js/stores/windowStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ let currentKey = 0
const incrementNextKey = () => ++currentKey

class WindowStore extends EventEmitter {
constructor() {
super()
// Many components can subscribe to changes in store state
// so ignore any memory-leak warning about having more than 10 listeners.
this.setMaxListeners(0)
}

getState () {
return windowState
}
Expand Down

0 comments on commit 5e072a4

Please sign in to comment.