Skip to content

Commit

Permalink
AG-16833 remove private mainCallback
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 24f00fabaf37a9a6cf29da32a1d33df199571892
Author: Slava Leleka <v.leleka@adguard.com>
Date:   Thu Oct 6 13:29:13 2022 +0300

    remove private mainCallback
  • Loading branch information
slavaleleka committed Oct 6, 2022
1 parent 36433d9 commit 0b96076
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/extended-css/extended-css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
AffectedElement,
BeforeStyleAppliedCallback,
Context,
MainCallback,
} from './helpers/types';

import { isBrowserSupported } from '../common/utils/user-agents';
Expand Down Expand Up @@ -92,8 +91,6 @@ export class ExtendedCss {

private applyRulesScheduler: AsyncWrapper;

private mainCallback: MainCallback;

// Instance of ExtCssDocument is needed for using selector-ast cache
extCssDocument: ExtCssDocument;

Expand Down Expand Up @@ -125,9 +122,8 @@ export class ExtendedCss {
});

this.applyRulesScheduler = new AsyncWrapper(this.context, applyRules, APPLY_RULES_DELAY);
this.mainCallback = this.applyRulesScheduler.run.bind(this.applyRulesScheduler);

this.context.mainCallback = this.mainCallback;
this.context.mainCallback = this.applyRulesScheduler.run.bind(this.applyRulesScheduler);

if (this.context.beforeStyleApplied && typeof this.context.beforeStyleApplied !== 'function') {
throw new Error(`Invalid configuration. Type of 'beforeStyleApplied' should be a function, received: '${typeof this.context.beforeStyleApplied}'`); // eslint-disable-line max-len
Expand Down

0 comments on commit 0b96076

Please sign in to comment.