flackr / scroll-timeline

A polyfill of ScrollTimeline.
Apache License 2.0
887 stars 82 forks source link

Ability to lazy load using import() function #241

Closed MurhafSousli closed 4 months ago

MurhafSousli commented 4 months ago

Is it possible to lazy load the script using import() function? I am trying to ship the polypill with my npm package library

@Injectable({ providedIn: 'root' })
export class ScrollbarManager {

  constructor() {    
    const polyfillScript = import('../scroll-timeline.js').then(x => {
      console.log(x)
    });
  }
}
MurhafSousli commented 4 months ago

I figured it out, thanks!