3 ms·
I really like the look of the composition API in Vue 3 though I have not used it yet, it gives me hope for addressing some of the issues you mention. I wonder d
by jeremyjh 3y ago
I really like the look of the composition API in Vue 3 though I have not used it yet, it gives me hope for addressing some of the issues you mention. I wonder does Svelte have anything comparable?
- gushogg-blake 3y agoFrom a quick look at the "What is Composition API?" question in the FAQ[1], I would say: - Reactivity API - yes, with $: labels - Lifecycle hooks - yes, similar to the ones mentioned - Dependency injection - not sure what it is exactly as I'm not familiar with Vue, but I don't think Svelte has a concept like this [1]: https://vuejs.org/guide/extras/composition-api-faq.html#what-is-composition-api https://vuejs.org/guide/extras/composition-api-faq.html#what...
- preommr 3y ago> - Dependency injection - not sure what it is exactly as I'm not familiar with Vue, but I don't think Svelte has a concept like this It's poorly named (holdover from earlier version of vue when svelte didnt exist and react didn't have contexts), but it's basically React/Svelte context API for passing data to children further down the tree instead of passing them through props or through a separate state management solution (e.g. vuex/redux). There's some nuance, but roughly: - getContext = provide - setContext = inject