Add a doc section on composables with guidelines about how to write them in the correct idiomatic way
Nobody has claimed this yet.
- Dominant language
- Vue
- Stars
- 3.2k
- Forks
- 5k
- Avg merge
- 14d 17h
- Merged PRs (30d)
- 1
Description
There are some significant composable libraries out there. And, since using the composition api and composables is such a great reuse tool it would be nice to know how to avoid problems.
Document the "useFeature" paradigm and how it interacts with the component scope and how reactivity works.
Examples, some of which I still don't understand fully:
- why the useFeature naming is a good idea
- does useFeature need to be exported by name like
import {useRoute} from 'vue-routeror should I export it as the default - global vs local/component scope in the composable
- if I create a composable
useFeatureand it needs to use vue router thenuseRouter()must be inside theuseFeaturefunction so it ends up in the proper scope in the component. - how does reactivity work
- computed function inside useFeature function
- computed function outside useFeature function
- passing a component prop to
useFeature(props.something) - etc
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing Vue documentation structure and current guidance on the Composition API and composables. Cover the useFeature naming and export questions, component scope, vue-router usage, and the listed reactivity cases; done when the guidance and examples explain each question clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100