hydrated_mobx 1.1.3
hydrated_mobx: ^1.1.3 copied to clipboard
An extension to the MobX state management library which automatically persists and restores MobX states.
Changelog #
1.1.3 - 2026-03-12 #
Added #
- Optional
storeIdparameter onHydratedMobX: pass a per-instance storage key (e.g.super(storeId: meetingId)) so hydration uses the correct key before subclass fields are initialized. Works with dependency injection (e.g. injectable, get_it). HydratedJsonhelpers for type-safefromJson/toJson:readList,readObject,readString,readInt,readDouble,readBool,writeList. They return safe defaults when keys are missing or types are wrong, so you can avoid manual type checks and try/catch.- Example app: KeyedCounterStore and keyed counter page demonstrating per-instance storage with
storeId.
Changed #
- Constructor is now the first member of
HydratedMobX(linter compliance). - Documentation and example snippets updated for the
storeIdpattern andHydratedJsonusage. - Resolved all analyzer/linter issues in
lib/(comment references, line length, sort order).
Note (medium risk) #
- The optional
storeIdparameter touches core persistence key generation. The storage key isstoragePrefix + (storeId ?? id). Stores that do not passstoreIdare unchanged (they still useid). If you rely on customidlogic or override storage keys, verify hydration/persistence behavior after upgrading. Other changes in this release are additive (HydratedJson, docs, example, iOS config).
1.1.2 - 2024-04-17 #
Fixed #
- Fixed example project to work with latest API changes
- Updated example dependencies to latest versions
1.1.1 - 2024-04-17 #
Fixed #
- Fixed dependency version constraints for better compatibility
- Resolved potential race conditions in state persistence
- Improved error handling for storage operations
1.1.0 - 2024-04-17 #
Changed #
- Breaking: Changed
HydratedMobXfrom a mixin to an abstract class- Now use
extends HydratedMobXinstead ofwith HydratedMobX - This change provides better type safety and clearer inheritance structure
- Now use
1.0.1 - 2024-04-16 #
Added #
- Enhanced JSON serialization support with proper type handling
- Support for complex object serialization through
toJsonmethods - Circular reference detection and prevention
- Improved error handling for unsupported types
- Better type safety in JSON conversion
Changed #
- Refactored JSON serialization implementation for better reliability
- Improved error messages for serialization failures