0.3.0 • Published 3 years ago

import-scheduler v0.3.0

Weekly downloads
18
License
MIT
Repository
github
Last release
3 years ago

import-scheduler

Dynamic import scheduler

NPM JavaScript Style Guide

Install

yarn add import-scheduler

Usage

import { importForInteractive } from 'import-scheduler';

const LazyComponent = lazy(async () => {
  await importForInteractive();
  return import('./component/lazy');
})

Kinds of schedulers:

  • importForDisplay(): Defers dynamic imports until the document.readyState becomes "interactive" ("DOMContentLoaded").
  • importForInteractive(): Defers dynamic imports until the document.readyState becomes "complete" ("load").
  • importForNextFrame(): Defers dynamic imports until the next frame.
  • importForTimeout(ms): Defers dynamic imports until a set timeout.

License

MIT © lxsmnsyc

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago