Fetchless just got even better! While version 1.3.0 introduced groundbreaking new features, the latest release—Fetchless 1.3.2—brings along important performance improvements, bug fixes, and enhanced compatibility. Install 1.3.2 now to experience the latest innovations!
🔍 Why Choose Fetchless?
Traditional HTTP libraries simply send a request and return a response. Modern applications, however, demand more:
- Enhanced Performance: Efficient caching minimizes redundant network calls.
- Robustness & Resilience: Automated error handling and recovery keep your app running smoothly.
- Simplicity: Zero configuration with intelligent defaults lets you focus on building features—no heavy setup required.
Fetchless combines lightweight design with automation and smart caching strategies, making it ideal for today’s fast-paced web applications.
🔥 New Features in Fetchless 1.3.0 (Now Part of 1.3.2)
Although these features were first introduced in version 1.3.0, they are now an integral part of the latest release:
Time Travel Fetch
Access historical data snapshots by specifying a timestamp.
Retrieve data as it existed in the past—perfect for audits, analytics, or debugging previous states.Freeze Mode
Freeze data updates while users are viewing the interface.
Ensure that critical data remains unchanged during user interactions, providing a stable and consistent user experience.Auto-Fixer
Automatically fix common API errors with fallback data.
When typical API errors occur (like 404s or transient network issues), Auto-Fixer supplies fallback data for uninterrupted service.Fetch Intelligence Panel
Analyze request patterns and detect inefficient fetching.
Gain insights into your API usage to optimize request strategies and reduce unnecessary network traffic.
⚙️ How It Works
Fetchless automates best practices such as intelligent caching, error recovery, and request deduplication—all without requiring manual configuration. This means you can build robust applications without spending time on complex network logic.
Example Usage
typescript
import { fetchless } from 'fetchless';
// Create a Fetchless client instance with advanced features enabled
const client = fetchless.createClient({
enableTimeTravel: true,
enableIntelligencePanel: true,
});
// Standard GET request with a 'stale-while-revalidate' caching strategy
const { data, error } = await client.get('https://api.example.com/data', {
strategy: 'stale-while-revalidate',
retry: true, // Automatically retry on failure
interceptors: [addAuthToken], // Custom interceptor for authentication
});
// Retrieve historical data using Time Travel Fetch (e.g., 24 hours ago)
const timestamp = new Date();
timestamp.setHours(timestamp.getHours() - 24);
const historicalData = await client.get('https://api.example.com/data', {
at: timestamp.toISOString(),
});
console.log('Current Data:', data);
console.log('Data 24 Hours Ago:', historicalData.data);
Top comments (0)