pinia
यह क्या करती है
यह स्किल बताती है कि Pinia का उपयोग करके Vue ऐप्स में साझा डेटा कैसे व्यवस्थित किया जाए। Pinia Vue के लिए आधिकारिक state लाइब्रेरी है। यह उन डेवलपरों के लिए है जिन्हें ऐप के कई हिस्सों में एक ही डेटा चाहिए।
कब इस्तेमाल करें
- ✓जब आप Vue ऐप बना रहे हैं और कई कंपोनेंट्स में साझा डेटा चाहिए।
- ✓जब आप state, getters और actions वाले स्टोर सेट करना चाहते हैं।
- ✓जब आपको Pinia स्टोर की जाँच या विस्तार करना है।
Skill का लिंक
https://github.com/antfu/skills/blob/main/skills/pinia/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“Pinia स्टोर बनाइए जो मेरे शॉपिंग कार्ट के आइटम और कुल रकम सभी पेजों पर रखे।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट ऐसे स्टोर सेट करता है जो साझा डेटा रखते हैं और उसे बदलने वाले actions, और यह Pinia के टाइप, टेस्टिंग और विस्तार पर मार्गदर्शन का पालन करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Pinia
Pinia is the official state management library for Vue, designed to be intuitive and type-safe. It supports both Options API and Composition API styles, with first-class TypeScript support and devtools integration.
The skill is based on Pinia v4.0.3, generated at 2026-09-25.
Core References
| Topic | Description | Reference |
|---|---|---|
| Stores | Defining stores, state, getters, actions, storeToRefs, subscriptions | core-stores |
Features
Extensibility
| Topic | Description | Reference |
|---|---|---|
| Plugins | Extend stores with custom properties, state, and behavior | features-plugins |
Composability
| Topic | Description | Reference |
|---|---|---|
| Composables | Using Vue composables within stores (VueUse, etc.) | features-composables |
| Composing Stores | Store-to-store communication, avoiding circular dependencies | features-composing-stores |
Best Practices
| Topic | Description | Reference |
|---|---|---|
| Testing | Unit testing with @pinia/testing, mocking, stubbing | best-practices-testing |
| Outside Components | Using stores in navigation guards, plugins, middlewares | best-practices-outside-component |
Advanced
| Topic | Description | Reference |
|---|---|---|
| SSR | Server-side rendering, state hydration | advanced-ssr |
| Nuxt | Nuxt integration, auto-imports, SSR best practices | advanced-nuxt |
| HMR | Hot module replacement for development | advanced-hmr |
Key Recommendations
- Prefer Setup Stores for complex logic, composables, and watchers
- Use
storeToRefs()when destructuring state/getters to preserve reactivity - Actions can be destructured directly - they're bound to the store
- Call stores inside functions not at module scope, especially for SSR
- Add HMR support to each store for better development experience
- Use
@pinia/testingfor component tests with mocked stores
अक्सर पूछे जाने वाले सवाल
क्या Pinia केवल Vue के लिए है?
यह Vue ऐप्स के लिए बनी है, और मार्गदर्शन इसी को कवर करता है।
क्या मैं अपने स्टोर की टेस्टिंग कर सकता हूँ?
हाँ। मार्गदर्शन में स्टोर की टेस्टिंग और मॉकिंग शामिल है।
क्या यह TypeScript के साथ काम करता है?
हाँ। Pinia टाइप-सेफ़ बनाई गई है और TypeScript को सपोर्ट करती है।
जानकारी
लेखक का मूल विवरण
Pinia official Vue state management library, type-safe and extensible. Use when defining stores, working with state/getters/actions, or implementing store patterns in Vue apps.
repo: antfu/skills
लोकप्रियता
- GitHub स्टार
- 6.0k
- रैंकिंग में स्थान
- #14442
- लाइसेंस
- MIT
- अपडेट की गई
- 30/10/2026
कमेंट
- …
इस repository की और skills
antfu-create-pr
6.0kआपके एजेंट को आपकी ब्रांच से GitHub पर साफ़ pull request खोलने में मदद करती है, जिसमें बदला गया और कारण का सरल सारांश होता है।
antfu-issue-triage
6.0kआपके एजेंट को खुले GitHub इश्यू और pull request छाँटने में मदद करती है, डुप्लिकेट और पहले से ठीक हो चुके आइटम पहचानकर, और कार्रवाई से पहले आपसे पूछकर।
antfu-query
6.0kआपके एजेंट को किसी योजना या विचार पर एक-एक करके सवाल पूछने देती है, जब तक आप दोनों एक स्पष्ट और परखी हुई समझ पर न पहुँच जाएँ।
antfu-simplify
6.0kआपके एजेंट को आपके कोड बदलावों को सबसे छोटे सही रूप में घटाने में मदद करती है, जिसमें जो ज़रूरी नहीं है उसे हटाया जाता है।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।