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

fix(transferstate): make sure it fires even on first load in lazy-loa… #268

Merged
merged 1 commit into from
Feb 3, 2020

Conversation

SanderElias
Copy link
Contributor

…ded module

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Other... Please describe:

What is the current behavior?

If you use getState for the first time in a lazy-loaded component, its state is not there.

What is the new behavior?

The state from getState is always loaded correctly

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Right now, we are booting the transferStateService on app boot, even of there is no use of getState at all.

@@ -26,7 +27,7 @@ export class IdleMonitorService {
private appReady = new Event('AngularReady', {bubbles: true, cancelable: false});
private appTimeout = new Event('AngularTimeout', {bubbles: true, cancelable: false});

constructor(private zone: NgZone, private router: Router) {
constructor(private zone: NgZone, private router: Router, private tss: TransferStateService) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm injecting it here because we are starting the idle-service anyway. This will get refactored in an upcomming PR

@SanderElias SanderElias merged commit 2da6614 into master Feb 3, 2020
@SanderElias SanderElias deleted the sander/getStateNotireing branch February 3, 2020 14:23
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

Successfully merging this pull request may close these issues.

2 participants