-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added: Succes pipe and code cleanup (#11)
- Loading branch information
1 parent
76e4097
commit 2252dfd
Showing
7 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Utils publish on tag | ||
name: npm publish on tag | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
ngrx-http-tracking/projects/ngrx-http-tracking/src/lib/function/map-action-typ-to-id.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export const mapActionTypeToId = (actionType: string) => | ||
actionType | ||
.toLowerCase() | ||
.replace(/success/g, '') | ||
.replace(/failure/g, '') | ||
.replace(/ success/g, '') | ||
.replace(/ failure/g, '') | ||
.trim() | ||
.replace(/ /g, '-'); |
19 changes: 19 additions & 0 deletions
19
ngrx-http-tracking/projects/ngrx-http-tracking/src/lib/function/tracking-success-pipe.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {Observable} from "rxjs"; | ||
import {HttpTrackingResult} from "../+state/http-tracking.facade"; | ||
export function httpTrackingSuccessFilter(source: Observable<HttpTrackingResult<any, any>>): Observable<boolean> { | ||
return new Observable(subscriber => { | ||
source.subscribe({ | ||
next(value) { | ||
if (value.success) { | ||
return subscriber.next(true); | ||
} | ||
}, | ||
error(error) { | ||
subscriber.error(error); | ||
}, | ||
complete() { | ||
subscriber.complete(); | ||
}, | ||
}); | ||
}); | ||
} |
4 changes: 1 addition & 3 deletions
4
ngrx-http-tracking/projects/ngrx-http-tracking/src/public-api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
/* | ||
* Public API Surface of http-tracking | ||
*/ | ||
export * from './lib/+state/http-tracking-facade.stub'; | ||
export * from './lib/+state/http-tracking.facade'; | ||
export * from './lib/function/http-tracking-actions.factory'; | ||
export * from './lib/http-tracking.module'; | ||
export * from './lib/model/http-tracking-entity'; | ||
export * from './lib/function/tracking-success-pipe'; |