Global Adapters
A collection of adapters for URPC that provide different data storage solutions. Choose the right adapter for your development needs.
Installation
npm install @unilab/urpc-adaptersAvailable Adapters
Memory Adapter
- Use case: Development, testing, temporary storage
- Storage: In-memory (lost on restart)
- Speed: Fastest access
- Best for: Development and caching
Mock Adapter
- Use case: Testing, prototyping
- Storage: In-memory (lost on restart)
- Speed: Fast
- Best for: Unit tests and demos
IndexedDB Adapter
- Use case: Browser applications
- Storage: Persistent browser storage
- Speed: Good performance
- Best for: Client-side apps, PWAs, offline support
Logging Middleware
Logging Middleware is a powerful middleware that automatically logs all repository operations including execution time, arguments, results, and error information. It provides detailed insights into your application's data access patterns and helps with debugging and monitoring.
IndexedDB Adapter
IndexedDB Adapter provides persistent browser storage for URPC entities using the IndexedDB API. Perfect for client-side applications that need data persistence across browser sessions.