@nextgis/progress
TypeScript icon, indicating that this package has built-in type declarations

3.0.0-alpha.13 • Public • Published

Progress

size version

Tracking the progress of asynchronous operations.

Installation

In Browser

Include assets

Simply download and include with a script tag, Progress will be registered as a global variable.

<script src="../lib/progress.global.js"></script>

<script>
  var progress = new Progress();
  progress.emitter.on('stop', function () {
    console.log('STOP LOADING')
  })
  progress.addLoading();
  progress.addLoaded();
</script>

CDN

unpkg

<script src="https://unpkg.com/@nextgis/progress"></script>

jsdelivr

<script src="https://cdn.jsdelivr.net/npm/@nextgis/progress"></script>

We recommend linking to a specific version number /progress@[version]

In Node.js

npm install @nextgis/progress

Usage

import Progress from '@nextgis/progress';

const progress = new Progress();

// emitted when the first loader is added
progress.emitter.on('start', () => {

});
// emitted when the last loader is removed
progress.emitter.on('stop', () => {

});
// emitted on each loader is added
progress.emitter.on('add', () => {

});
// emmitted on each loader is removed
progress.emitter.on('remove', () => {

});

progress.addLoading();
fetch(url).finally(() => {
  progress.addLoaded();
})

Check out the API Documentation

Commercial support

Need to fix a bug or add a feature to @nextgis/progress? We provide custom development and support for this software. Contact us to discuss options!

http://nextgis.com

/@nextgis/progress/

    Package Sidebar

    Install

    npm i @nextgis/progress

    Weekly Downloads

    5

    Version

    3.0.0-alpha.13

    License

    MIT

    Unpacked Size

    8.59 kB

    Total Files

    21

    Last publish

    Collaborators

    • rendrom
    • maximdubinin
    • karavanjo