Skip to content

Commit

Permalink
Rx.throwError isn't an operator
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Apr 28, 2020
1 parent 80139ff commit 06c2a8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/optimize/bundles_route/file_hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { createHash } from 'crypto';
import Fs from 'fs';

import * as Rx from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { takeUntil, mergeMap } from 'rxjs/operators';

import { FileHashCache } from './file_hash_cache';

Expand All @@ -45,7 +45,7 @@ export async function getFileHash(cache: FileHashCache, path: string, stat: Fs.S

const promise = Rx.merge(
Rx.fromEvent<Buffer>(read, 'data'),
Rx.fromEvent<Error>(read, 'error').pipe(Rx.throwError)
Rx.fromEvent<Error>(read, 'error').pipe(mergeMap(error => Rx.throwError(error)))
)
.pipe(takeUntil(Rx.fromEvent(read, 'end')))
.forEach(chunk => hash.update(chunk))
Expand Down

0 comments on commit 06c2a8c

Please sign in to comment.