How to use the nprogress.isStarted function in nprogress

To help you get started, we’ve selected a few nprogress examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / nprogress / nprogress-tests.ts View on Github external
import NProgress, { NProgressOptions } from 'nprogress';

console.log(NProgress.status);
console.log(NProgress.version);

// $ExpectType NProgress
NProgress.start();
NProgress.inc()
    .inc(0.2)
    .done();

NProgress.set(0.5);
NProgress.trickle();
console.log(NProgress.isStarted());
NProgress.done(true);

NProgress.configure({ minimum: 0.1 });
NProgress.configure({
    template: '<div></div>',
    easing: 'ease',
    speed: 500,
    trickle: true,
    showSpinner: false,
    trickleSpeed: 250,
    parent: '#content',
    // $ExpectError
    foo: ''
});
github AsamK / JodelJS / src / views / Progress.tsx View on Github external
public componentWillUnmount() {
        if (this.timer) {
            clearTimeout(this.timer);
        }
        if (NProgress.isStarted()) {
            NProgress.done();
        }
    }
github LWJGL / lwjgl3-www / client / components / LoadingPage.jsx View on Github external
function stop() {
  if (nprogress.isStarted()) {
    nprogress.done();
  }
}
github Mesamo / dva-admin / src / routes / App / index.js View on Github external
componentDidMount() {
    if (NProgress.isStarted()) {
      NProgress.done()
    }
  }
github Mesamo / dva-admin / src / routes / App / index.js View on Github external
componentDidUpdate() {
    if (NProgress.isStarted()) {
      NProgress.done()
    }
  }
github AsamK / JodelJS / src / views / Progress.tsx View on Github external
public componentDidUpdate(prevProps: IProgressProps) {
        if (prevProps.isFetching === this.props.isFetching) {
            return;
        }

        if (this.props.isFetching) {
            this.timer = window.setTimeout(() => NProgress.start(), 150);
        } else {
            if (this.timer) {
                clearTimeout(this.timer);
            }
            if (NProgress.isStarted()) {
                NProgress.done();
            }
        }
    }