Skip to content

Conversation

@MichaHuhn
Copy link
Contributor

Simplify the icon canvas updates in IconCanvas.vue.

I'm using watchEffect() here. It works similar to watch() but you don't need to pass in the source data you want to watch.

The triggerGenerator() function will be executed only if the icon canvas is initialized and it will be executed whenever the currentIcon in the iconsStore updates.


It's a good practice in Vue to put normal TypeScript functions into normal TypeScript files, so Vue components only need to manage Vue related code.
The awesome side effect is that you can unit-test those TypeScript functions very easily without needing to mount the Vue components.

That's why I moved the triggerGenerator() function into the generators.ts file next to the getMatchingGenerator() function.
The component now only needs to call this function.

@sebinside sebinside added the enhancement New feature or request label Aug 27, 2025
@sebinside sebinside added this to the v3.1.0 milestone Aug 27, 2025
@sebinside sebinside merged commit 0113bab into sebinside:develop Sep 7, 2025
1 check passed
@MichaHuhn MichaHuhn deleted the refactor/simplify-icon-canvas-updates branch September 7, 2025 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants