mobile-offline-support by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill mobile-offline-support设计离线优先的移动应用程序,无论网络连接状况如何,都能提供无缝的用户体验。
最小工作示例:
import AsyncStorage from '@react-native-async-storage/async-storage';
import NetInfo from '@react-native-community/netinfo';
class StorageManager {
static async saveItems(items) {
try {
await AsyncStorage.setItem(
'items_cache',
JSON.stringify({ data: items, timestamp: Date.now() })
);
} catch (error) {
console.error('Failed to save items:', error);
}
}
static async getItems() {
try {
const data = await AsyncStorage.getItem('items_cache');
return data ? JSON.parse(data) : null;
} catch (error) {
console.error('Failed to retrieve items:', error);
return null;
}
}
// ... (完整实现请参阅参考指南)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
references/ 目录下的详细实现:
| 指南 | 内容 |
|---|---|
| React Native 离线存储 | React Native 离线存储 |
| iOS Core Data 实现 | iOS Core Data 实现 |
| Android Room 数据库 | Android Room 数据库 |
每周安装量
148
代码仓库
GitHub 星标数
116
首次出现
2026年1月21日
安全审计
安装于
opencode130
gemini-cli125
codex123
claude-code121
cursor112
github-copilot103
Design offline-first mobile applications that provide seamless user experience regardless of connectivity.
Minimal working example:
import AsyncStorage from '@react-native-async-storage/async-storage';
import NetInfo from '@react-native-community/netinfo';
class StorageManager {
static async saveItems(items) {
try {
await AsyncStorage.setItem(
'items_cache',
JSON.stringify({ data: items, timestamp: Date.now() })
);
} catch (error) {
console.error('Failed to save items:', error);
}
}
static async getItems() {
try {
const data = await AsyncStorage.getItem('items_cache');
return data ? JSON.parse(data) : null;
} catch (error) {
console.error('Failed to retrieve items:', error);
return null;
}
}
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| React Native Offline Storage | React Native Offline Storage |
| iOS Core Data Implementation | iOS Core Data Implementation |
| Android Room Database | Android Room Database |
Weekly Installs
148
Repository
GitHub Stars
116
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode130
gemini-cli125
codex123
claude-code121
cursor112
github-copilot103
Android 整洁架构指南:模块化设计、依赖注入与数据层实现
1,400 周安装
GitHub Actions 工作流规范创建指南:AI优化模板与CI/CD流程设计
8,200 周安装
GitHub Copilot SDK 官方开发包 - 在应用中嵌入AI智能体工作流(Python/TypeScript/Go/.NET)
8,200 周安装
AI提示工程安全审查与改进指南 - 负责任AI开发、偏见检测与提示优化
8,200 周安装
GitHub Copilot 提示词构建器 - 专业提示工程工具,提升AI编程效率
8,300 周安装
AI实施方案生成器 - 创建机器可读、结构化的自动化执行计划
8,300 周安装
Python MCP 服务器生成器 - 快速构建 Model Context Protocol 服务器工具
8,400 周安装