Skip to content

Commit 59963fd

Browse files
updated readme.
1 parent 2c58504 commit 59963fd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,24 @@ export class NotificationService<T> {
4848

4949
public subscribeMap(
5050
observer: Observable<any>,
51-
mapDataFrom?: (data: any) => T,
52-
mapErrorFrom?: (error: any) => any
51+
mapData?: (data: any) => T,
52+
mapError?: (error: any) => any
5353
) {
5454
this.resetError();
5555
observer.subscribe({
5656
next: (data) => {
5757
console.log('Data loaded successfully', data);
58-
if (mapDataFrom) {
59-
var d = mapDataFrom(data);
58+
if (mapData) {
59+
var d = mapData(data);
6060
this.data$.next(d);
6161
return;
6262
}
6363
this.data$.next(data);
6464
},
6565
error: (e) => {
6666
console.error('Error loading data', e.message);
67-
if (mapErrorFrom) {
68-
e = mapErrorFrom(e);
67+
if (mapError) {
68+
e = mapError(e);
6969
}
7070
this.error$.next(e);
7171
}

0 commit comments

Comments
 (0)