4 ms·
From 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, simil
by gushogg-blake 3y ago
From 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