Skip to content

Draft: Fix #297 - Provide new API to abstract the subscription update business logic

Anton Smirnov requested to merge issue-297 into next

Since we need to provide a way to use custom scheduling API, a Scheduler abstract class and TimeoutScheduler concrete impl are introduced.

Notifications (and synchronizer though it has a default impl set in ctor) now require scheduler instance to be set with setScheduler:

    const {TimeoutScheduler} = require("./scheduler");
    ..
    notifications.setScheduler(new TimeoutScheduler());
    notifications.start();

Here is how browser.alert()-based impl could be implemented (proposed to have in webext-sdk).

Edited by Anton Smirnov

Merge request reports