JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 22
  • Score
    100M100P100Q49919F
  • License MIT

Helper component for pagination in Angular and Ionic.

Package Exports

  • @molecule/pagination

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@molecule/pagination) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

MoleculeLifecycle

CircleCI Codecov npm (scoped)

The @MoleculeLifecycle-Decorator creates rxjs streams for all Angular and Ionic lifecycle hooks. Hooks will only be overridden when requesting their stream, in order to reduce unnecessary overhead.

@MoleculeLifecycle()
@Component({
  template: '{{latestDescription$|async}}'
})
export class YourComponent implements OnMoleculeLifecycle {
  @Input() description: Observable<string> | string;
  readonly latestDescription$: Observable<string>;
  readonly ngOnChanges$: Observable<SimpleChanges>;
  readonly ngOnDestroy$: Observable<void>;

  constructor() {
    this.latestDescription$ = this.ngOnChanges$.pluck('description', 'currentValue')
      .switchMap(newValue => {
        if (newValue instanceof Observable) {
          return <Observable<string>>newValue;
        } else {
          return Observable.of(newValue);
        }
      })
      .takeUntil(this.ngOnDestroy$)
      .subsrcibe();
  }
}

Installation

$ npm install --save @molecule/lifecycle-decorator

Author

Valentin Knabel, @vknabel, dev@vknabel.com

License

@molecule/lifecycle-decorator is available under the MIT license.