Skip to main content

localstorage-utilities-template

Template for creating localStorage utility functions following established patterns. Use when creating new localStorage utilities, when storage patterns need standardization, or when error handling is needed. Provides template code with error handling and validation.

معلومات المصدر

المستودع
pmarashian/cursor-agent-skills
آخر نشاط في المصدر
١٣ فبراير ٢٠٢٦ في ١٩:٥١
لغة SKILL.md المكتشفة
الإنجليزية
النجوم
٢
التفرعات
١

خيارات التثبيت

يُحدَّد Prompt الذي يراجع المصدر أولًا بشكل افتراضي. يمكنك التبديل إلى أمر مباشر أو تنزيل نسخة محلية.

مراجعة ملفات المصدر

اقرأ SKILL.md وأي ملفات مرافقة يعرضها SkillsMP قبل أن تقرر التثبيت.

مستكشف الملفات
2 ملفات

عرض SKILL.md

SKILL.md
تعليمات المصدر · معاينة للقراءة فقط
name
localStorage-utilities-template
description
Template for creating localStorage utility functions following established patterns. Use when creating new localStorage utilities, when storage patterns need standardization, or when error handling is needed. Provides template code with error handling and validation.
# localStorage Utilities Template ## Overview Template for creating localStorage utilities following established patterns. Standardize utility creation with consistent error handling and validation. ## Template See `assets/template.ts` for complete localStorage utility template. ## Key Features - Error handling (availability checks, JSON parsing) - Data validation - Default fallback values - Consistent API: `load*()`, `save*()`, `get*()` - Exported storage keys ## Usage 1. Copy `assets/template.ts` to your utility file 2. Replace `DataType` with actual type 3. Replace `DEFAULT_DATA` with actual defaults 4. Update `STORAGE_KEY` with camelCase key name 5. Customize validation if needed ## Best Practices - Use camelCase for storage keys - Always include error handling - Validate parsed data structure - Export storage keys as constants - Use consistent API naming ## Resources - `assets/template.ts` - Template code with error handling, validation
عرض على GitHub