Concept Flow - Composable with lifecycle hooks
Start Component Setup
Call Composable Function
Inside Composable: Setup Reactive State
Register Lifecycle Hook (e.g., onMounted)
Return State and Methods
Component Uses Returned State
Component Mounts
Lifecycle Hook Runs
Effect Happens (e.g., console log, data fetch)
Component Renders with Updated State
The component calls a composable that sets up reactive state and registers lifecycle hooks. When the component mounts, the lifecycle hook inside the composable runs, triggering side effects.