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

[Ivy] 9.0.0-beta.0 - Life Cycle Effects Hook loses context #2373

Closed
jerryorta-dev opened this issue Feb 12, 2020 · 5 comments · Fixed by #2386
Closed

[Ivy] 9.0.0-beta.0 - Life Cycle Effects Hook loses context #2373

jerryorta-dev opened this issue Feb 12, 2020 · 5 comments · Fixed by #2386

Comments

@jerryorta-dev
Copy link

jerryorta-dev commented Feb 12, 2020

NgRX 9.0.0-beta.0 , Angular 9.0.0, Node 12.3.0:

The lifecycle ngrxOnInitEffects is broken - it loses the context of "this" so code inside that hook doesn't understand the class properties, methods, constructor injections -- Rolling back to 8.6.0 works.

Other information:

I would be willing to submit a PR to fix this issue

[ ] Yes (Assistance is provided if you need help submitting a pull request)
[x] No

@GuateDevIO
Copy link

Experiencing the same issue. This can be reproduced by adding an ngrxOnInitEffects to the NgRx example-app repo.

class AuthEffects implements OnInitEffects {
  ngrxOnInitEffects(): Action {
    return { type: '[Auth]: Auth Init' };
  }

initAuth$ = createEffect(() =>
    this.actions$.pipe(
      ofType('[Auth]: Auth Init'),
      tap(action => {
        console.log('test ngrxOnInitEffects');
      })
    ),
  { dispatch: false });
}

@timdeschryver
Copy link
Member

I haven't verified if this is the culprit, but there has been a change to OnInit in the v9 release - a528320

@Wildhammer
Copy link

Wildhammer commented Feb 14, 2020

@timdeschryver @brandonroberts when is the release date of NGRX 9 stable?

@brandonroberts
Copy link
Member

No specific release date yet, but soon-ish.

@timdeschryver
Copy link
Member

@jerryorta-dev fyi, this wasn't the cause of Ivy - see #2386 for more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants