Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/whitelisting.js

Issue 29339020: Issue 3868 - Use the new FilterNotifier API (Closed)
Patch Set: Updated depdendencies and use EventEmitter.listeners() Created March 24, 2016, 3:29 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/subscriptionInit.js ('k') | metadata.common » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/whitelisting.js
===================================================================
--- a/lib/whitelisting.js
+++ b/lib/whitelisting.js
@@ -91,20 +91,19 @@
function revalidateWhitelistingState(page)
{
- FilterNotifier.triggerListeners(
+ FilterNotifier.emit(
"page.WhitelistingStateRevalidate",
page, checkWhitelisted(page)
);
}
-FilterNotifier.addListener(action =>
+FilterNotifier.on("filter.behaviorChanged", () =>
{
- if (action == "filter.behaviorChanged")
- ext.pages.query({}, pages =>
- {
- for (let page of pages)
- revalidateWhitelistingState(page);
- });
+ ext.pages.query({}, pages =>
+ {
+ for (let page of pages)
+ revalidateWhitelistingState(page);
+ });
});
ext.pages.onLoading.addListener(revalidateWhitelistingState);
« no previous file with comments | « lib/subscriptionInit.js ('k') | metadata.common » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld