
Mobile Offline Support
This is a solid foundation for building offline-first mobile apps with React Native. You get local storage through AsyncStorage, a sync queue that automatically processes when connectivity returns, and basic conflict resolution strategies. The queue management is thoughtful, capping at 1000 items and discarding oldest entries when full, which prevents unbounded memory growth. The code includes placeholder API calls you'll need to wire up to your backend, and the conflict resolution defaults to last-write-wins though you can swap in merge logic. It covers the essential pattern of cache-first reads and queued writes, plus includes a simple offline banner component. Best suited for apps where occasional sync conflicts are acceptable and you need basic offline capabilities without reaching for a full framework like WatermelonDB.
- skills.sh installs
- 412
- GitHub stars
- 248
- last updated
- Aug 21, 2026
Install
$ npx -y skills add secondsky/claude-skills --skill mobile-offline-support --agent claude-codeInstalls into .claude/skills of the current project.
Files
Mobile Offline Support
Build offline-first mobile applications with local storage and synchronization.
React Native Implementation
import AsyncStorage from '@react-native-async-storage/async-storage';
import NetInfo from '@react-native-community/netinfo';
class OfflineManager {
constructor() {
this.syncQueue = [];
this.isOnline = true;
// Maximum items in sync queue before discarding oldest
this.MAX_SYNC_QUEUE_LENGTH = 1000;
NetInfo.addEventListener(state => {
this.isOnline = state.isConnected;
if (this.isOnline) this.processQueue();
});
}
/**
* Fetch data from server.
* TODO: Replace with actual API endpoint implementation.
*/
async fetchFromServer(key) {
try {
// Example implementation - replace with your API
const response = await fetch(`${API_BASE_URL}/data/${key}`);
if (!response.ok) {
throw new Error(`Server returned ${response.status}`);
}
return await response.json();
} catch (error) {
console.error('fetchFromServer failed:', error);
throw new Error(`Failed to fetch ${key}: ${error.message}`);
}
}
Sponsors
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Backend & APIs, Mobile Development
- First seen
- Jun 3, 2026
More from secondsky/claude-skills
All 146- Recommendation System412
- Api Versioning Strategy410
- Claude Code Bash Patterns408
- Claude Hook Writer408
- Logging Best Practices408
- Cloudflare Manager407
- Plan Interview406
- Ml Pipeline Automation402
- Nuxt Core401
- Nuxt Data400
- Microservices Patterns398
- Multi Ai Consultant397
- Graphql Implementation393
- Mcp Management393
- Model Deployment393
- Jest Generator391
- Cloudflare Agents389
- Cloudflare Mcp Server388
- Thesys Generative Ui384
- Access Control Rbac381
- Maz Ui380
- React Best Practices380
- Woocommerce Backend Dev379
- Woocommerce Code Review379