@fancyawesome/progress-service
v2.0.1
Published
A simple progress service for tracking active actions and showing status messages. Depends on Aurelia, Toastr, and Nanobar. Customized specifically for use a Fancy Awesome.
Downloads
27
Readme
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 suitenpm run test:watch
: Run test suite in interactive watch modenpm run test:prod
: Run linting + generate coveragenpm run dev
: Run a server atlocalhost:8081
(default) for quick developmentnpm run build
: Bundles code, create docs and generate typingsnpm run build:dev
: Same thanbuild
, but code is not minifiednpm run commit
: Commit using conventional commit style (husky will tell you to use it if you haven't :wink:)
To commit, you must use npm run commit
, which is a convenient way to create conventional commits.