lazyfetch

1.2.2 • Public • Published



Load stuff lazily on the browser.

 

  • only 376 bytes (gzip)
  • ignored on the server (relevant for server side rendering)

 

Usage

npm install lazyfetch --save

import lazyfetch from 'lazyfetch'

lazyfetch(
  /* list of urls to load */
  [
    'https://example.com/script.js',
    'https://example.com/styles.css'
  ],
  /* callback to execute after all of the urls have been fetched */
  () => {
    // ...
  }
)

or load in the browser

<script async src="https://unpkg.com/lazyfetch/lib.js"></script>

 

like it?

this repo

 

license

MIT © siddharthkp

Logo credits to Chris Lau

Package Sidebar

Install

npm i lazyfetch

Weekly Downloads

1

Version

1.2.2

License

MIT

Last publish

Collaborators

  • siddharthkp