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

method to avoid code duplication with initial component value #37

Merged
merged 1 commit into from
May 25, 2024

Conversation

Vrixyz
Copy link
Contributor

@Vrixyz Vrixyz commented May 13, 2024

I found it a bit counterintuitive to be forced to add a "placeholder" component only to have it "replaced immediately", so I did a helper function to help with that.

It might not be worth the added cognitive load of an additional function hiding "complexity", but this pattern has helped me with bigger components where in practice I had to declare it above the spawn, then clone it, or implement default.

@Vrixyz Vrixyz changed the title add helper method to avoid code duplication method to avoid code duplication with initial component value May 13, 2024
@mockersf
Copy link
Member

clippy failure not related

@mockersf
Copy link
Member

thanks!

@mockersf mockersf merged commit c39c202 into vleue:main May 25, 2024
6 of 7 checks passed
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