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

2.0.1 • Public • Published

Progress Service

A simple abstraction over Toastr and Nanobar to centralize vizualization of "in progress actions". Automatically tracks and vizualizes router navigation events, and exposes the ability to easy track other async operations.

Ex:

import ProgressService from "@fancyawesome/progres-service";
import { autoinject } from "aurelia-framework";

@autoinject
export class MyPage {
  constructor(private readonly progressService: ProgressService) { }
}

public async myAsyncThing() {
  const status = this.progressService.start();
  try {
    const result = await someLongOperation();
    if (result.isErr()) {
      status.cancel("Failed to do the first thing.");
    }

    status.increment();

    await someOtherLongOperation();

    status.ok("Did the thing!");
  } catch (e) {
    status.error(e);
  }
}

Based on: https://github.com/alexjoverm/typescript-library-starter

NPM scripts

  • npm t: Run test suite
  • npm run test:watch: Run test suite in interactive watch mode
  • npm run test:prod: Run linting + generate coverage
  • npm run dev: Run a server at localhost:8081 (default) for quick development
  • npm run build: Bundles code, create docs and generate typings
  • npm run build:dev: Same than build, but code is not minified
  • npm run commit: Commit using conventional commit style (husky will tell you to use it if you haven't 😉)

To commit, you must use npm run commit, which is a convenient way to create conventional commits.

Readme

Keywords

none

Package Sidebar

Install

npm i @fancyawesome/progress-service

Weekly Downloads

0

Version

2.0.1

License

MIT

Last publish

Collaborators

  • rosswright
  • richicoder