| Index: lib/synchronizer.js |
| =================================================================== |
| --- a/lib/synchronizer.js |
| +++ b/lib/synchronizer.js |
| @@ -16,44 +16,42 @@ |
| */ |
| "use strict"; |
| /** |
| * @fileOverview Manages synchronization of filter subscriptions. |
| */ |
| -const {Downloader, Downloadable, |
| - MILLIS_IN_SECOND, MILLIS_IN_MINUTE, |
| - MILLIS_IN_HOUR, MILLIS_IN_DAY} = require("./downloader"); |
| -const {Filter} = require("./filterClasses"); |
| -const {FilterStorage} = require("./filterStorage"); |
| -const {FilterNotifier} = require("./filterNotifier"); |
| -const {Prefs} = require("prefs"); |
| -const {Subscription, |
| - DownloadableSubscription} = require("./subscriptionClasses"); |
| -const {Utils} = require("utils"); |
| +import {Downloader, Downloadable, |
| + MILLIS_IN_SECOND, MILLIS_IN_MINUTE, |
| + MILLIS_IN_HOUR, MILLIS_IN_DAY} from "./downloader"; |
| +import {Filter} from "./filterClasses"; |
| +import {FilterStorage} from "./filterStorage"; |
| +import {FilterNotifier} from "./filterNotifier"; |
| +import {Prefs} from "prefs"; |
| +import {Subscription, DownloadableSubscription} from "./subscriptionClasses"; |
| +import {Utils} from "utils"; |
| const INITIAL_DELAY = 1 * MILLIS_IN_MINUTE; |
| const CHECK_INTERVAL = 1 * MILLIS_IN_HOUR; |
| const DEFAULT_EXPIRATION_INTERVAL = 5 * MILLIS_IN_DAY; |
| /** |
| * The object providing actual downloading functionality. |
| * @type {Downloader} |
| */ |
| let downloader = null; |
| /** |
| * This object is responsible for downloading filter subscriptions whenever |
| * necessary. |
| * @class |
| */ |
| -let Synchronizer = exports.Synchronizer = |
| -{ |
| +export let Synchronizer = { |
| /** |
| * Called on module startup. |
| */ |
| init() |
| { |
| downloader = new Downloader(this._getDownloadables.bind(this), |
| INITIAL_DELAY, CHECK_INTERVAL); |
| onShutdown.add(() => |