Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra comma being added after migration #53

Closed
ndcunningham opened this issue Aug 8, 2018 · 1 comment
Closed

Extra comma being added after migration #53

ndcunningham opened this issue Aug 8, 2018 · 1 comment

Comments

@ndcunningham
Copy link

ndcunningham commented Aug 8, 2018

Hi after running: rxjs-5-to-6-migrate -p ./tsconfig.json there seems to be a problem with some of my observable definitions as a comma (,) is being added at the end of the chain.

Please see some examples below:

BEFORE

 return this.httpService
      .patch(url, body)
      .do((response: any) => {
        // do stuff
      })
      .catch(e => this.isError409(e));

AFTER

    return this.httpService
      .patch(url, body).pipe(
      tap((response: any) => {
       // do stuff
      }),
      catchError(e => this.isError409(e)),);

As you can see at the catchError line a , was added.

Another example is here:

BEFORE

  click$ = Observable.defer(() => Observable.fromEvent(this.ele.nativeElement, 'click'))
    .takeUntil(this.destroy$)
    .publish();

AFTER

  click$ = observableDefer(() => observableFromEvent(this.ele.nativeElement, 'click')).pipe(
    takeUntil(this.destroy$),
    publish(),);

Is this expected?
Is there a CLI flag that i might have missed?

Thank you.

@mgechev
Copy link
Collaborator

mgechev commented Aug 8, 2018

Hey @ndcunningham, thanks for giving the tool a try! I'm happy you were able to migrate your app. The trailing comma is not an invalid syntax. As we've recommended in readme, after you run the migration tool, you can format your code with prettier or clang-format to make sure everything aligns with your coding style.

@mgechev mgechev closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants