Q: RxJS: map function not reached I've implemented this dunction:
public deleteCards(user: string, tokens: Array<string>, extraHttpRequestParams?: any): Observable<{}> {
    return this.deleteCardsWithHttpInfo(user, tokens, extraHttpRequestParams)
        .map((response: Response) => {
            if (response.status === 204) {
                return undefined;
            } else {
                return response.json();
            }
        }).catch((error: any) => {
            if (error.status >= 500) {
                return Observable.throw(new Error(error.status));
            }
            else { //if (error.status >= 400) {
                const body = error.json() || '';
                const code = body.error || JSON.stringify(body);
                const message = body.message || JSON.stringify(body);
                return Observable.throw(ApiError.create(code, message));
            }
        });
}

As you can see, it returns an Observable<{}>. I'm calling that as:
this.deleteCards(action.payload.username, action.payload.tokens)
      .map(() => {   ((((1))))
        return <Action>{
          type: 'DELETE_CARDS_SUCCESS',
          payload: action.payload.tokens
        };
      })
      .catch(_ => {
        return Observable.of(<Action>{ type: 'DELETE_CARDS_FAILED', payload: { }});
      }));

Nevertheless, ((((1)))) is never reached.
I've also tried with this:


*

*.map(_ => { ...

*.map((p:any) => {...
but it's never reached.

A: You have to subscribe to the observable for it to do anything:
this.deleteCards(...).map(...).catch(...).subscribe((action: Action) => {
    // do something with the action.
});

