@twaves/imagepreload

1.0.1 • Public • Published

install

  sudo npm install @twaves/imagepreload

Use

  import ImagePreload from '@twaves/imagepreload';

  ImagePreload({
    data: [
      {
        url: 'resource url include http or https',
        type: 'bg' // background tag
      },
      {
        url: 'resource url include http or https',
        type: 'img' // img tag
      }
    ],

    // Download resources with a few milliseconds delay, default: 0
    delay: 1000,

    // The minimum number of milliseconds to download resources
    minTime: 1000,

    // Download progress
    onProgress: (percent) => {
      console.log('percent', percent); // [0-100]
    },

    // Download completed
    onComplete: () => {
      console.log('complete'); // complete
    }
  })

Readme

Keywords

Package Sidebar

Install

npm i @twaves/imagepreload

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

3.77 kB

Total Files

3

Last publish

Collaborators

  • skywalker0723