reduxjs/reselect
Selector library for Redux
🚀 Reselect — Selector memoization cho Redux
Thư viện tạo selector đã được memoization, giảm tính toán lại không cần thiết.
Reselect là thư viện TypeScript tạo các hàm selector đã được memoization. Dùng phổ biến với Redux, nhưng cũng hỗ trợ bất kỳ dữ liệu bất biến nào. Selector tính toán dữ liệu phái sinh, giúp Redux lưu trữ trạng thái tối thiểu.
✨ Điểm nổi bật
- Selector memoization: Không tính toán lại trừ khi đối số thay đổi
- Composable selectors: Selector có thể dùng làm đầu vào cho selector khác
- Tích hợp Redux Toolkit: Được bao gồm sẵn, không cần cài thêm
- createSelector API: Tạo selector từ input selectors và result function
- Reference equality: Trả về cùng tham chiếu nếu không tính toán lại, tối ưu React-Redux
- Tùy biến memoization: Hỗ trợ memoize và argsMemoize tùy chỉnh qua createSelectorCreator
💡 Vì sao đáng chú ý
Reselect khác biệt bằng cách tránh tính toán lại hoàn toàn khi dữ liệu đầu vào không thay đổi. Điều này rất quan trọng cho các ứng dụng lớn nơi việc lọc hoặc tính toán dữ liệu phứt phức có thể gây chậm. Kết hợp với React-Redux, selector memoization giúp UI chỉ cập nhật khi thực sự cần thiết.
#Redux #TypeScript #Memoization #Selectors #ReactRedux #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 modified web browser that helps in responsive web development. A web developer's must have dev-tool.
A cross platform desktop reading app, based on the Readium Desktop toolkit