JSPM

lasso-loader

3.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2556
  • Score
    100M100P100Q108530F
  • License Apache-2.0

Module to support lazy loading of JavaScript and CSS resources

Package Exports

  • lasso-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lasso-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

lasso-loader

This module provides functionality to asynchronously load JavaScript and CSS resources in any web browser. It's used by Lasso.js to support lazily loading resources, but it can also be used independently of Lasso.js.

NOTE: All resources are loaded in parallel.

Usage

var lassoLoader = require('lasso-loader');

lassoLoader.load({
        js: [
            'http://foo.com/static/foo.js',
            'http://foo.com/static/bar.js'
        ],
        css: [
            'http://foo.com/static/foo.css',
            'http://foo.com/static/bar.css'
        ]
    },
    function(err) {
        if (err) {
            // Something went wrong
        } else {
            // All resources successfully loaded!
        }
    });