RepositoryTypeScriptITItaly
toomuchdesign

toomuchdesign/re-reselect

Enhance Reselect selectors with deeper memoization and cache management.

1.1ksao
46fork
2issue
1lượt xem

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: memoization

#1 Repository Của Tháng

1
TINIX TRENDING·Chủ đề: reselect

#1 Repository Của Tháng

8
TINIX TRENDING·Chủ đề: reactjs

#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.

RepositoryTypeScript
theKashey/kashe

A memoization library based on weakmaps. 🤯 Sometimes cache is kashe

70
Aug 31, 2025
RepositoryTypeScript
twentyhq/twenty

The open alternative to Salesforce, designed for AI.

59.7k
Oct 25, 2026
RepositoryTypeScript
pmndrs/zustand

🐻 Bear necessities for state management in React

58.9k
Oct 22, 2026
RepositoryTypeScript
react-hook-form/react-hook-form

📋 React Hooks for form state management and validation (Web + React Native)

44.9k
Oct 22, 2026
RepositoryTypeScript
chakra-ui/chakra-ui

Chakra UI is a component system for building SaaS products with speed ⚡️

40.7k
Oct 26, 2026
RepositoryTypeScript
CopilotKit/CopilotKit

The Frontend Stack for Agents & Generative UI. React, Angular, Mobile, Slack, and more. Makers of the AG-UI Protocol

38.2k
Oct 26, 2026
RepositoryTypeScript
NervJS/taro

开放式跨端跨框架解决方案,支持使用 React/Vue 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。

37.7k
Oct 21, 2026
RepositoryTypeScript
heroui-inc/heroui

🚀 Beautiful, fast and modern React UI library. (Previously NextUI)

31.0k
Oct 23, 2026
RepositoryTypeScript
mastra-ai/mastra

Mastra is the modern TypeScript framework for AI-powered applications and agents.

29.1k
Oct 26, 2026