watchable_redux 1.3.0 copy "watchable_redux: ^1.3.0" to clipboard
watchable_redux: ^1.3.0 copied to clipboard

Predictable state management for Flutter. Redux architecture with O(1) selector caching, memoized selectors, async middleware, and time-travel debugging. Built on Watchable.

Changelog #

All notable changes to the watchable_redux package will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

1.3.0 - 2025-12-12 #

Added #

  • Redux.reset() method for proper singleton store cleanup and re-initialization
  • Auto-memoization for only and when parameters in Store.build() (no manual memoization needed)
  • Comprehensive test suite with 300+ tests covering edge cases, stress tests, and complex scenarios

Changed #

  • Renamed Store.build() parameters: selectoronly, shouldRebuildwhen
  • Inlined Dispatcher and GetState typedefs into ThunkAction (removed from public API)

Documentation #

  • Added EffectsMiddleware.dispose() documentation for proper cleanup
  • Updated README with new parameter names (only:, when:)

1.2.3 - 2025-12-12 #

Documentation #

  • Document both store.build() and store.select().build() patterns in README
  • Added build method to API Reference section

1.2.2 - 2025-12-12 #

Documentation #

  • Removed benchmark comparison tables and performance metrics from README
  • Retained Performance Tips section for developer guidance

1.2.1 - 2025-12-12 #

Documentation #

  • Added equals: deepEquals example to Quick Start section in README

1.2.0 - 2025-12-12 #

Added #

  • equals parameter in Store constructor for optional deep equality checking
  • deepEquals<T> function for comparing collections (uses listEquals, mapEquals, setEquals)
  • StateEquals<S> typedef for equality functions

Performance #

  • Equality check runs O(n) once per dispatch (not per-subscriber)
  • Default identical() remains for O(1) performance with immutable patterns

Usage #

// With deep equality (prevents rebuilds for same-content collections)
final store = Store<AppState>(
  initialState: AppState.initial(),
  reducer: appReducer,
  equals: deepEquals,  // Built-in deep equality
);

// Without (default - fastest for immutable patterns)
final store = Store<AppState>(
  initialState: AppState.initial(),
  reducer: appReducer,
);

1.1.0 - 2025-12-12 #

Performance #

  • 6x faster state updates with optimized Watchable integration
  • Middleware chain now cached at construction time (no per-dispatch allocation)
  • Benchmarks show ~10.6M ops/sec with 100 listeners (vs ~1.8M previously)

Changed #

  • Updated to use watchable: ^6.0.0 for optimized performance
  • watchableState getter now returns Watchable<S> instead of AbstractWatchable<S>

1.0.1 - 2025-12-04 #

Added #

  • Comprehensive dartdoc documentation for all public APIs
  • Library-level documentation with usage examples
  • Documentation for Store, DevTools, ReduxAction, Reducer, Selector, Middleware, StoreProvider, and Redux

Improved #

  • Documentation coverage increased from 1.4% to 23%+ (exceeds pub.flutter-io.cn 20% requirement)

1.0.0 - 2025-12-04 #

Added #

Core Redux Architecture

  • ReduxAction - Base class for all actions with pattern matching support
  • Reducer<S> - Type-safe state reducers with immutable updates
  • Store<S> - Centralized state container with O(1) selector caching
  • combineReducers - Utility to compose multiple reducers into one

Selectors with Memoization

  • createSelector through createSelector5 - Reselect-style memoized selectors
  • Automatic cache invalidation when input dependencies change
  • O(1) selector lookup via internal caching

Middleware System

  • Middleware<S> - Intercept and transform actions before reducers
  • thunkMiddleware - Async action support with dispatch/getState access
  • EffectsMiddleware - Stream-based side effects for complex async flows
  • loggerMiddleware - Debug logging for actions and state changes

Time-Travel DevTools

  • DevTools<S> - State history recording and navigation
  • undo() / redo() - Step through state history
  • jumpTo(index) - Jump to any point in history
  • reset() - Return to initial state
  • clear() - Clear history while keeping current state
  • maxHistoryLength - Configurable history size limit

Provider System

  • StoreProvider<S> - InheritedWidget for store access
  • Redux singleton - Global store access pattern
  • context.store<S>() - Extension for easy store access
  • context.dispatch<S>() - Extension for dispatching actions

Flutter Integration

  • .build() extension on AbstractWatchable for reactive UI
  • O(1) rebuilds with .map().distinct() optimization
  • Automatic subscription management

Technical Highlights #

  • O(1) Selector Performance - Cached selectors prevent redundant computations
  • Minimal Rebuilds - Only affected widgets rebuild on state change
  • Type Safety - Full Dart type system support with generics
  • Zero Boilerplate - Clean API inspired by modern Redux patterns
  • Comprehensive Testing - 120+ tests covering all functionality

Dependencies #

  • watchable: ^6.0.0 - High-performance reactive state primitives
  • flutter SDK

Quality Assurance #

  • 120+ comprehensive test cases
  • 100% test success rate
  • Zero analyzer warnings
  • Full type safety validation
0
likes
160
points
237
downloads

Publisher

verified publisherdipendrasharma.com

Weekly Downloads

Predictable state management for Flutter. Redux architecture with O(1) selector caching, memoized selectors, async middleware, and time-travel debugging. Built on Watchable.

Repository (GitHub)
View/report issues

Topics

#state-management #redux #flutter #reactive #watchable

Documentation

Documentation
API reference

License

BSD-3-Clause (license)

Dependencies

flutter, watchable

More

Packages that depend on watchable_redux