rt2zz/redux-persist

persist and rehydrate a redux store

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 58 minutes ago
Added to GitGenius on October 12th, 2024
Created on July 23rd, 2015
Open Issues & Pull Requests: 593 (+0)
Number of forks: 842
Total Stargazers: 12,958 (+0)
Total Subscribers: 81 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 1709.5 days
Mean response time: 1425.6 days
90th percentile: 2726.2 days
Tracked items: 69

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 99% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Only 2% of issues opened in the past year have been closed.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 393
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 2,367 days
Stale 30+ days: 393
Stale 90+ days: 383

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • stale (45)
  • bug report (14)
  • question (13)
  • v5 (8)
  • usability (7)
  • feature request (6)
  • docs (5)
  • needs test repo (5)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Redux Persist is a library that enables Redux applications to persist their state to storage and rehydrate it on subsequent loads. Written in TypeScript, the library provides middleware and reducer enhancement utilities that allow developers to automatically save Redux store state to browser storage, React Native storage, or other custom storage engines, then restore that state when the application restarts.

The core functionality centers on two main functions. The persistReducer function wraps a Redux reducer and enhances it to handle persistence logic, accepting configuration for which parts of state to persist through whitelist and blacklist options. The persistStore function wraps a Redux store and returns a persistor object with methods to control persistence behavior, including purge to clear stored state, flush to immediately write pending changes, pause to stop persistence temporarily, and persist to resume it. The library also provides PersistGate, a React component that delays rendering the application until persisted state has been fully rehydrated, preventing UI flashes from incomplete state.

A critical feature is state reconciliation, which determines how persisted state merges with initial state when the application loads. Redux Persist ships with three reconcilers. The default autoMergeLevel1 performs a shallow merge one level deep, preserving initial state properties not present in persisted state. The hardSet reconciler completely replaces initial state with persisted state, useful for nested persist configurations. The autoMergeLevel2 reconciler extends merging to two levels deep for more complex state structures.

The library supports migrations through a general-purpose migrate configuration option that transforms stored state before reconciliation, enabling developers to update persisted state schemas across application versions. Redux Persist also provides a createMigrate utility for synchronous migrations. Transforms allow customization of what gets persisted and how, with the ecosystem including separate libraries for compressing state, encrypting sensitive data, filtering subsets of state, and handling immutable data structures.

Bug reports and stale issues represent the most common issue labels, with some issues requiring test repositories for reproduction.

The repository underwent significant modernization in 2021. In October 2021, the codebase migrated from Flow type annotations to TypeScript as part of infrastructure upgrades, and the project moved from TravisCI to GitHub Actions for continuous integration.

The v6 release introduced no breaking changes for web applications but required React Native users to explicitly pass their storage engine. The library integrates with the broader Redux ecosystem and is classified across multiple domains including local storage, offline support, data synchronization, session management, and platform compatibility for both web and React Native environments.