Skip to content

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

Merged
SanderElias merged 1 commit intomasterfrom
sander/getStateNotireing
Feb 3, 2020
Merged

fix(transferstate): make sure it fires even on first load in lazy-loa…#268
SanderElias merged 1 commit intomasterfrom
sander/getStateNotireing

Conversation

@SanderElias
Copy link
Copy Markdown
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.

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
Copy Markdown
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