Skip to content

Follow-up items from updating table of contents component to glimmer #827

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

Merged
merged 2 commits into from
Nov 19, 2022
Merged

Follow-up items from updating table of contents component to glimmer #827

merged 2 commits into from
Nov 19, 2022

Conversation

geneukum
Copy link
Contributor

Let's follow-up on the suggested tweaks to the table-of-contents component from: #809 by:

  1. avoiding the action helper
  2. avoiding the Input component which provides a 2-way binding on the @checked arg

Let's avoid using the `action` helper and instead prefer to use the `on`
and `fn` helpers together. These new helpers have more clearly
delineated responsibilities, which should make the operations a little
bit easier to understand.
Let's avoid using the `Input` component, as this provides a two-way binding on
the @checked argument. Let's use the regular `input` tag here with an
`onchange` helper to handle the toggling event.
Comment on lines +125 to +128
@action
togglePrivateClasses() {
set(this, 'showPrivateClasses', !this.showPrivateClasses);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's also follow up on this and get rid of the CP macro in favor of actually using tracked state on the service. I know that the service and the way these CPs work are a bit janky today, but I did a spike where I just swapped it all out for a simple set of tracked properties and not trying to do those janky things in the CPs and it actually “just worked” (though we should of course verify that).

@chriskrycho chriskrycho merged commit db828db into ember-learn:master Nov 19, 2022
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