When to composable? #6632
Replies: 3 comments 12 replies
-
For me this is a helper function and not a composable. Reason being that a composable should be stateful meaning that the above function would be reactive in some form so |
Beta Was this translation helpful? Give feedback.
-
Your example doesn't really tie into Vue in any way; it has no reactive state, doesn't register with any lifecycle hook, doesn't provide/inject anything, etc. |
Beta Was this translation helpful? Give feedback.
-
Did you find any answers? or any updates? |
Beta Was this translation helpful? Give feedback.
-
Lately, one Vue discussion keeps going around among the devs in our coworking space. In short: "When to composable?". We keep arguing about the question when to create a composable as opposed to a "simple" helper/util function that is not using any Vue building blocks at all. Quick real world example:
Would it be fair to call this a composable? Or is this really more a helper function, better placed in a lib-folder (e.g. to be used in a monorepo).
Beta Was this translation helpful? Give feedback.
All reactions