Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
refactor: fix tsconfig configuration and codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
klemenoslaj committed Mar 3, 2019
1 parent 95699c5 commit 6c22abf
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 23 deletions.
43 changes: 28 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
<center>

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f495c18616434c3ca2fafe26f89a818f)](https://app.codacy.com/app/klemenoslaj/ng-action-outlet?utm_source=github.com&utm_medium=referral&utm_content=klemenoslaj/ng-action-outlet&utm_campaign=Badge_Grade_Settings)
[![Travis build](https://img.shields.io/travis/klemenoslaj/ng-action-outlet/master.svg)](https://travis-ci.org/klemenoslaj/ng-action-outlet)
[![Coveralls github](https://img.shields.io/coveralls/klemenoslaj/ng-action-outlet/master.svg)](https://coveralls.io/github/klemenoslaj/ng-action-outlet?branch=master)
[![David](https://img.shields.io/david/klemenoslaj/ng-action-outlet/master.svg)](https://david-dm.org/klemenoslaj/ng-action-outlet)

[![Compodoc tag](./docs/images/coverage-badge.svg)](https://klemenoslaj.github.io/ng-action-outlet/coverage.html)
[![License](https://img.shields.io/npm/l/@ng-action-outlet/core.svg)](https://github.com/klemenoslaj/ng-action-outlet/blob/master/LICENSE)
[![GitHub tag](https://img.shields.io/github/tag/klemenoslaj/ng-action-outlet.svg)](https://github.com/klemenoslaj/ng-action-outlet/releases)
[![Known Vulnerabilities](https://snyk.io/test/github/klemenoslaj/ng-action-outlet/badge.svg?targetFile=package.json)](https://snyk.io/test/github/klemenoslaj/ng-action-outlet?targetFile=package.json)

[![Angular Style Guide](https://mgechev.github.io/angular2-style-guide/images/badge.svg)](https://angular.io/styleguide)

</center>
<p align="center">

<a href="https://app.codacy.com/app/klemenoslaj/ng-action-outlet?utm_source=github.com&utm_medium=referral&utm_content=klemenoslaj/ng-action-outlet&utm_campaign=Badge_Grade_Settings">
<img src="https://api.codacy.com/project/badge/Grade/f495c18616434c3ca2fafe26f89a818f" /></a>
<a href="https://travis-ci.org/klemenoslaj/ng-action-outlet">
<img src="https://img.shields.io/travis/klemenoslaj/ng-action-outlet/master.svg" /></a>
<a href="https://coveralls.io/github/klemenoslaj/ng-action-outlet?branch=master">
<img src="https://img.shields.io/coveralls/klemenoslaj/ng-action-outlet/master.svg" /></a>
<a href="https://david-dm.org/klemenoslaj/ng-action-outlet">
<img src="https://img.shields.io/david/klemenoslaj/ng-action-outlet/master.svg" /></a>

<br />

<a href="https://img.shields.io/npm/l/@ng-action-outlet/core.svg">
<img src="https://img.shields.io/npm/l/@ng-action-outlet/core.svg" /></a>
<a href="https://github.com/klemenoslaj/ng-action-outlet/releases">
<img src="https://img.shields.io/github/tag/klemenoslaj/ng-action-outlet.svg" /></a>
<a href="https://snyk.io/test/github/klemenoslaj/ng-action-outlet?targetFile=package.json">
<img src="https://snyk.io/test/github/klemenoslaj/ng-action-outlet/badge.svg?targetFile=package.json" /></a>
<a href="https://klemenoslaj.github.io/ng-action-outlet/coverage.html">
<img src="./docs/images/coverage-badge.svg" /></a>

<br />

<a href="https://angular.io/styleguide">
<img src="https://mgechev.github.io/angular2-style-guide/images/badge.svg" /></a>

</p>

# [NgActionOutlet](https://klemenoslaj.github.io/ng-action-outlet/)

Expand Down
6 changes: 3 additions & 3 deletions projects/core/src/lib/action-abstract/action-abstract.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { BehaviorSubject, never, Observable } from 'rxjs';
import { BehaviorSubject, NEVER, Observable } from 'rxjs';
import { filter } from 'rxjs/operators';
import { TestScheduler } from 'rxjs/testing';

import { ActionGroup } from '../action-group/action-group';
import { ActionAbstract, ActionState } from './action-abstract';

class ActionAbstractTest extends ActionAbstract<any, any> {
changes$: any = never();
fire$: any = never();
changes$: any = NEVER;
fire$: any = NEVER;

state: BehaviorSubject<ActionState>;

Expand Down
4 changes: 2 additions & 2 deletions projects/core/src/lib/action-abstract/action-abstract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@angular/core';
import { BehaviorSubject, Observable, never } from 'rxjs';
import { BehaviorSubject, Observable, NEVER } from 'rxjs';
import { distinctUntilChanged , filter, switchMap, takeUntil } from 'rxjs/operators';

import { ActionAbstractComponentImpl, ActionAbstractEvent, ActionAbstractOptions } from '../action-abstract/action-abstract.model';
Expand Down Expand Up @@ -246,7 +246,7 @@ export abstract class ActionAbstract<Options extends ActionAbstractOptions, Fire
*/
protected handleActivateState<T>(observable: Observable<T>): Observable<T> {
return this.state.pipe(
switchMap(state => state === ActionState.Inactive ? (never()) : observable)
switchMap(state => state === ActionState.Inactive ? (NEVER) : observable)
);
}

Expand Down
4 changes: 2 additions & 2 deletions projects/core/src/lib/action-group/action-group.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@angular/core';
import { BehaviorSubject, Observable, never, merge } from 'rxjs';
import { BehaviorSubject, Observable, NEVER, merge } from 'rxjs';
import { map } from 'rxjs/operators';

import { ActionAbstract } from '../action-abstract/action-abstract';
Expand Down Expand Up @@ -106,7 +106,7 @@ export class ActionGroup extends ActionAbstract<ActionGroupOptions, ActionGroupE
this.children = new BehaviorSubject(unique(this.options.children.map(action => action._setParent(this))));
this.dropdown = new BehaviorSubject(this.options.dropdown);

this.fire$ = this.handleLivecycle(never(), false);
this.fire$ = this.handleLivecycle(NEVER, false);
this.children$ = this.handleLivecycle(this.children.asObservable());
this.dropdown$ = this.handleLivecycleDistinct(this.dropdown.asObservable());

Expand Down
2 changes: 1 addition & 1 deletion projects/core/src/lib/action-outlet.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ export class ActionOutletDirective implements OnDestroy {
* @param injector `Injector` from current directive instance
*/
getComponentType(action: AnyAction, injector: Injector): Type<ActionAbstractComponentImpl> {
return action.getForcedComponent() || <Type<ActionAbstractComponentImpl>>injector.get(action.constructor);
return action.getForcedComponent() || <Type<ActionAbstractComponentImpl>>injector.get<any>(<any>action.constructor);
}
}

0 comments on commit 6c22abf

Please sign in to comment.