feat: add withHistory, devtools, and subscribeKey utilities for enhanced state management#7
Merged
feat: add withHistory, devtools, and subscribeKey utilities for enhanced state management#7
withHistory, devtools, and subscribeKey utilities for enhanced state management#7Conversation
…ith tests and documentation
…ith tests and documentation
… enhanced state management - `withHistory`: Adds undo/redo functionality to stores with a snapshot stack. - `devtools`: Integrates stores with Redux DevTools for debugging and time travel. - `subscribeKey`: Enables subscribing to changes on specific properties in stores.
…tilities - Added `useLocalStore` details to architecture and docs. - Expanded file structures to include `devtools`, `subscribeKey`, and `withHistory` utilities. - Refined examples and tutorials for consistency and clarity.
…safety checks - Wrapped state application logic in `try-finally` blocks to ensure cleanup (`isTimeTraveling`, `paused`, `hydrating`) regardless of errors. - Improved safety by skipping operations during invalid states (e.g., `hydration`/`disposed` in `persist`). - Added `shallowEqual` utility export to utils index.
- Added additional tests for `devtools` to cover time travel, error handling, and message payloads. - Extended test cases for `persist` to handle null states, invalid envelopes, and unsubscribe behavior. - Introduced more cases for `subscribeKey` with various data types and subscriber behavior. - Enhanced `shallowEqual` tests to include edge cases such as array vs object comparison and handling undefined values.
… and computed behavior - Added extensive tests for `useStore` covering error handling, multiple stores, selector edge cases, and derived selectors. - Enhanced `computed getter` memoization tests, including nested dependencies and structural sharing across versions. - Expanded test cases for `snapshot` behavior, including object freezing, deleted properties, and specialized structures. - Introduced test cases for `ReactiveMap` and `ReactiveSet` with numeric keys, `NaN`, object keys, and snapshot consistency. - Improved coverage for version tracking, child proxy management, and error scenarios in `core`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
withHistory: Adds undo/redo functionality to stores with a snapshot stack.devtools: Integrates stores with Redux DevTools for debugging and time travel.subscribeKey: Enables subscribing to changes on specific properties in stores.