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

doc(routing): explain activation strategies #475

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

doc(routing): explain activation strategies #475

wants to merge 1 commit into from

Conversation

Alfhir
Copy link

@Alfhir Alfhir commented Mar 22, 2020

I would like to add the explanation Huochunpeng gave to me in this thread.

@EisenbergEffect
Copy link
Contributor

Thank you for your contribution @Alfhir. Would it be possible for you to revert all the changes related purely to Markdown syntax? Those changes make this document different in style from most of the rest of the document and also obscure what the new content is. It looked like it was the addition of a single paragraph at the end only, but I wasn't sure when trying to review.

@Alfhir
Copy link
Author

Alfhir commented Mar 22, 2020

Sorry for the sloppy PR. It should really only change the paragraph at the end of the document (L1177+): Reusing an Existing View Model.
Seems like my IDE again deleted some WS from line endings in three other places. Would you like me to change that back as well?

* replace
* invoke-lifecycle.

`Replace` does not re-use the existing view-model, i.e. you get a new instance of product. This is less performant but if your view model builds up local state, you will have a clean start.`Invoke-lifecycle` means, invoke the navigation lifecycle. Aurelia then re-uses the View-Model and (only) issues canDeactivate, deactivate, canActivate, activate callbacks on the same instance - e.g. new Product() - when switching from one route to another. This is efficient, but might surprise developers, because the view-model instance is not in a clean state.
Copy link
Member

Choose a reason for hiding this comment

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

Pls correct the values to be the correct string used in code, fix Replace to replace, and Invoke-lifecycle to invoke-lifecycle.

Copy link
Member

Choose a reason for hiding this comment

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

There is a missing space before `invoke... too.

Copy link
Author

Choose a reason for hiding this comment

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

Thx for the help. I did so.

@Alfhir
Copy link
Author

Alfhir commented Mar 23, 2020

I am not that familiar with english grammar, should it be

invoke-lifecycle means: invoke the navigation

or

invoke-lifecycle means, ...

@3cp
Copy link
Member

3cp commented Mar 23, 2020

I guess invoke-lifecycle means to invoke the navigation lifecycle or invoke-lifecycle means invoking the navigation lifecycle.
Normally, @EisenbergEffect will clean up new doc anyway. 😄

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.

None yet

3 participants