Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOM Routines major refactoring, final cut #38

Merged
merged 6 commits into from
Feb 2, 2022

Conversation

dhilt
Copy link
Owner

@dhilt dhilt commented Feb 2, 2022

This PR provides an additional parameter to the Workflow constructor, which allows to override default behaviour of the DOM Routines.

// routines.ts
import { IRoutines } from 'vscroll';

export class Routines implements Partial<IRoutines> {
  readonly settings: IRoutines['settings'];
  readonly element: HTMLElement;
  readonly viewport: HTMLElement;

  checkElement(element: HTMLElement): void {
    if (!element) {
      throw new Error('HTML element is not defined !!!');
    }
  }
}
// workflow.ts
import { Workflow } from 'vscroll';
import { Routines } from './routines';

...

new Workflow({
      consumer,
      element,
      datasource,
      run,
      Routines
    });

Relates to issue #29.

@dhilt dhilt merged commit d267568 into main Feb 2, 2022
@dhilt dhilt deleted the issue-29-dom-routines-refactoring-final branch February 2, 2022 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant