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

cleanup active computed property #15779

Merged
merged 1 commit into from
Nov 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/ember-glimmer/lib/components/link-to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,7 @@ const LinkComponent = EmberComponent.extend({
@property active
@private
*/
active: computed('attrs.params', '_active', function computeLinkToComponentActiveClass(this: any) {
let currentState = get(this, '_routing.currentState');
if (!currentState) { return false; }
Copy link
Member

Choose a reason for hiding this comment

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

This existed to avoid computing active if routing was not started (e.g. from integration or unit tests where there is no routing). Can you confirm that _active does not throw in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@rwjblue @bekzod Why was 'attrs.params' removed? CC: @jasonmit (#16060)


active: computed('activeClass', '_active', function computeLinkToComponentActiveClass(this: any) {
return this.get('_active') ? get(this, 'activeClass') : false;
}),

Expand Down