Socket
Socket
Sign inDemoInstall

angular-async-tracker

Package Overview
Dependencies
4
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    angular-async-tracker

A port of angular-promise-tracker to angular 6+ that also supports observables


Version published
Weekly downloads
6
decreased by-33.33%
Maintainers
1
Install size
206 kB
Created
Weekly downloads
 

Changelog

Source

2.0.0 (2018-05-14)

Features

  • upgrade to angular 6 (342865e)

BREAKING CHANGES

  • angular 6 or higher is now required to use this module. Also the AsyncTrackerModule has been removed. To migrate, just remove it from your code.

<a name="1.0.2"></a>

Readme

Source

angular async tracker

Build Status codecov npm version devDependency Status GitHub issues GitHub stars GitHub license

Table of contents

About

A port of angular-promise-tracker to angular 6+ that also supports observables

Installation

Install through npm:

npm install --save angular-async-tracker

Finally use in one of your apps components:

import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Subscription } from 'rxjs';
import { take } from 'rxjs/operators';
import { AsyncTrackerFactory, AsyncTracker } from 'angular-async-tracker';

@Component({
  template: `
    <span *ngIf="asyncTracker.active">Loading...</span>
    <button *ngIf="!asyncTracker.active" (click)="save()">Save</button>
  `
})
export class MyComponent {
  asyncTracker: AsyncTracker;

  constructor(
    private http: HttpClient,
    asyncTrackerFactory: AsyncTrackerFactory
  ) {
    this.asyncTracker = asyncTrackerFactory.create();
  }

  save() {
    const saved: Subscription = this.http
      .post('/foo', { bar: 'bam' })
      .pipe(take(1))
      .subscribe(result => {
        console.log(result);
      });
    // `asyncTracker.add` accepts promises or observable subscriptions
    this.asyncTracker.add(saved);
  }
}

Documentation

All documentation is auto-generated from the source via compodoc and can be viewed here: https://mattlewis92.github.io/angular-async-tracker/docs/

Development

Prepare your environment

  • Install Node.js and NPM (should come with)
  • Install local dev dependencies: npm while current directory is this repo

Development server

Run npm start to start a development server on port 8000 with auto reload + tests.

Testing

Run npm test to run tests once or npm run test:watch to continually run tests.

Release

npm run release

License

MIT

Keywords

FAQs

Last updated on 14 May 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc