Repository navigation
Releases
Releases · frontendfixer/-use-fetch
v0.2.15
v0.2.12
v0.1.10
Release Notes
@frontendfixer/use-fetch v1.0.0 (2024-11-13)
🎉 First Release
Initial release of the @frontendfixer/use-fetch package, providing a robust and type-safe HTTP client utility for modern web applications.
✨ Features
- Type-Safe Requests: Full TypeScript support with generics for type-safe API responses
- Environment Handling: Automatic switching between production and development URLs
- Advanced Error Handling: Comprehensive error handling with structured responses
- Request Cancellation: Built-in support for cancellable requests using AbortController
- FormData Support: Native support for handling multipart/form-data requests
- Caching Control: Flexible cache control options for requests
- Authentication: Built-in JWT token support
- Credentials: Automatic handling of credentials with 'include' option
🔧 Technical Details
- Built on top of the native Fetch API
- Zero external dependencies
- Full TypeScript support
- Environment-aware configuration
- Comprehensive error handling
📝 Documentation
- Added comprehensive API documentation
- Included usage examples for common scenarios
- Added TypeScript type definitions
- Included environment setup guide
🏗️ Installation
npm install @frontendfixer/use-fetch
# or
yarn add @frontendfixer/use-fetch
# or
pnpm add @frontendfixer/use-fetch💡 Quick Start
import { fetchService } from '@frontendfixer/use-fetch';
const getData = async () => {
const response = await fetchService<YourDataType>({
method: 'GET',
url: '/api/endpoint'
});
return response.data;
};🔍 Requirements
- Node.js 16.0.0 or later
- TypeScript 4.5.0 or later (for TypeScript users)
🐛 Known Issues
None at this time.
📋 TODO
- Add request interceptors
- Add response transformers
- Add retry mechanism for failed requests
- Add request queuing
- Add offline support
🤝 Contributing
Contributions are welcome! Please read our contributing guidelines before submitting pull requests.
📄 License
MIT License - see the LICENSE file for details.
For more information, please visit the documentation.
Report any issues at our GitHub repository.