Skip to content

feat(scully runtime config): user forRoot to pass config to Scully#271

Merged
SanderElias merged 2 commits intomasterfrom
sander/forRootConfig
Feb 4, 2020
Merged

feat(scully runtime config): user forRoot to pass config to Scully#271
SanderElias merged 2 commits intomasterfrom
sander/forRootConfig

Conversation

@SanderElias
Copy link
Copy Markdown
Contributor

The transferState service now only gets activated when the config using forRoot says so.

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?

transferStateService is always monitoring the route, and trying to load data, even when s/getState is not used at all.

What is the new behavior?

transferStateService is only monitoring if the user tells it so by using the config in forRoot
like this:

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    HttpClientModule,
    AppRoutingModule,
    ScullyLibModule.forRoot({useTranferState: true}),
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

The transferState service now only gets activated when the config using forRoot says so.
Copy link
Copy Markdown
Contributor

@jorgeucano jorgeucano left a comment

Choose a reason for hiding this comment

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

I love it, but this is a breaking change if the people by default have false, we need add this into the document with the PR :)

@Villanuevand
Copy link
Copy Markdown
Contributor

Im totally agree with @jorgeucano
We need to update the docs, and also release the new version ..

…event braking change

This is a better default aas it's not breaking anymore, but still enables people to opt-out
@SanderElias SanderElias merged commit 7d643c0 into master Feb 4, 2020
@SanderElias SanderElias deleted the sander/forRootConfig branch February 4, 2020 10:28
@SanderElias
Copy link
Copy Markdown
Contributor Author

I changed the default to true so there is no breaking chance anymore.

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.

3 participants