Skip to content

Commit

Permalink
Rename to mapResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-okrushko committed Nov 3, 2020
1 parent 7a369a2 commit cd4adfe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/component-store/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './component-store';
export * from './handle-response';
export * from './map-response';
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { EMPTY, Observable } from 'rxjs';
import { catchError, tap } from 'rxjs/operators';

/**
* Handles the response in ComponentStore effects in a safe way, without
* Maps the response in ComponentStore effects in a safe way, without
* additional boilerplate.
* It enforces that error case is handled and that the effect would still be
* It enforces that the error case is handled and that the effect would still be
* running should an error occur.
*
* Takes an optional third argument for a `complete` callback.
Expand All @@ -15,14 +15,14 @@ import { catchError, tap } from 'rxjs/operators';
* return alert$.pipe(
* concatMap(
* (alert) => this.alertsService.dismissAlert(alert).pipe(
* handleResponse(
* mapResponse(
* (dismissedAlert) => this.alertDismissed(dismissedAlert),
* (error) => this.logError(error),
* ))));
* });
* ```
*/
export function handleResponse<T>(
export function mapResponse<T>(
nextFn: (next: T) => void,
errorFn: (error: unknown) => void,
completeFn?: () => void
Expand Down

0 comments on commit cd4adfe

Please sign in to comment.