Italytoomuchdesign/re-reselect
Enhance Reselect selectors with deeper memoization and cache management.
Thành tựu nổi bật
Những danh hiệu mới nhất của dự án
#1 Repository Của Tháng
#1 Repository Của Tháng
#8 Repository Của Tháng
🚀 re-reselect: Memoization sâu cho Reselect
Tăng cường memoization sâu và quản lý cache cho bộ chọn Reselect.
re-reselect là một wrapper nhẹ cho [Reselect][reselect], nâng cấp memoization sâu và quản lý cache. Với reselect tiêu chuẩn, chỉ số cache mặc định giới hạn ở 1, gây mất cache khi gọi với tham số khác nhau. re-reselect chuyển tiếp các lời gọi khác nhau tới các selector Reselect riêng biệt được lưu trong cache.
✨ Điểm nổi bật
- createCachedSelector: Tạo selector với hỗ trợ cache đa tham số
- keySelector: Hàm xác định cacheKey từ tham số đầu vào
- Giữ nguyên cache: Tránh tính lại khi gọi lặp lại cùng tham số
- Chia sẻ selector: Dùng chung selector cho nhiều instance component
- Chiến lược cache tùy chỉnh: Hỗ trợ cache objects linh hoạt
- API tương thích: Hoạt động như selector Reselect thông thường
💡 Vì sao đáng chú ý
re-reselect giải quyết vấn đề mất cache khi gọi selector với tham số khác nhau — vấn đề thường gặp trong ứng dụng React/Redux. Thay vì tạo selector mới cho mỗi trường hợp, re-reselect tự động lưu và tái sử dụng selector đã tính toán. Đặc biệt hữu ích khi cần chia sẻ selector giữa nhiều component hoặc tính toán expensiveComputation với các bộ tham số khác nhau.
#reselect #reactjs #memoization #cachemanagement #TiniX
Dự án tương tự
Khám phá các dự án và mô hình AI khác có sự tương đồng.
A memoization library based on weakmaps. 🤯 Sometimes cache is kashe
📋 React Hooks for form state management and validation (Web + React Native)
Chakra UI is a component system for building SaaS products with speed ⚡️
The Frontend Stack for Agents & Generative UI. React, Angular, Mobile, Slack, and more. Makers of the AG-UI Protocol
开放式跨端跨框架解决方案,支持使用 React/Vue 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。
🚀 Beautiful, fast and modern React UI library. (Previously NextUI)
Mastra is the modern TypeScript framework for AI-powered applications and agents.