redux_dev_tools 0.5.2

  • Readme
  • Changelog
  • Installing
  • 85

redux_dev_tools #

Build Status codecov

A Redux Store with a Delorean.

This library allows you to create a DevToolsStore during dev mode in place of a normal Redux Store. This DevToolsStore will act exactly like a normal Store at first, with one catch: It will allow you to travel back and forth throughout the State of your application!

You can write your own UI to travel in time, or use one of the existing options for the platform you're working with:

Demo #

Flutter #

A simple Flutter app that allows you to Increment and Decrement a counter.

A screenshot of the Dev Tools in Action

Usage #

// Start by creating a simple Reducer, or a complex one. Dealer's choice. :)
int addOneReducer(int state, action) => state + 1;

// For production mode, this is how you should create your Store.
final store = new Store(addReducer, initialState: 0);

// In Dev Mode, however, if you want to hook up to Time-Traveling 
// Dev Tools, create a `DevToolsStore` instead!
// It will act exactly like your normal Store, but give you super powers
// to travel back and forth in time throughout your app States!
// Remember: By itself this will beef up your Store, but will not provide
// a UI to Time Travel. See the libraries listed above to learn how to
// connect your Redux store to a UI! 
final store = new DevToolsStore(addReducer, initialState: 0);

Credits #

All of this code was directly inspired by the original Redux Devtools.

Changelog #

0.5.2 #

  • Bugfix: actually return value from dispatch. Thanks @dennis-tra

0.5.1 #

  • Bugfix: return dynamic from dispatch

0.5.0 #

  • Update to support Redux 4.x - 5.0

0.4.0 #

  • Fix Dart 2 environment constraint

0.3.0 #

  • Dart 2 / Redux 3.0.0 Support

0.2.0 #

  • Bump version of Redux and add distinct option to DevToolsStore

0.1.4 #

  • Don't advance position on recompute

0.1.3 #

  • Fix Type signature for Middleware

0.1.2 #

  • Move to Github

0.1.1 #

  • Update README

0.1.0 #

  • Initial version. Allows you to create a DevToolsStore during dev mode, which will allow you to time travel through the states of your application.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  redux_dev_tools: ^0.5.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:redux_dev_tools/redux_dev_tools.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13

Health suggestions

Fix lib/src/store.dart. (-4.89 points)

Analysis of lib/src/store.dart reported 10 hints, including:

line 46 col 35: Use = to separate a named parameter from its default value.

line 47 col 20: Use = to separate a named parameter from its default value.

line 48 col 18: Use = to separate a named parameter from its default value.

line 50 col 27: Unnecessary new keyword.

line 52 col 48: Unnecessary new keyword.

Fix lib/src/reducer.dart. (-3.45 points)

Analysis of lib/src/reducer.dart reported 7 hints, including:

line 25 col 16: Unnecessary new keyword.

line 31 col 16: Unnecessary new keyword.

line 44 col 16: Unnecessary new keyword.

line 51 col 16: Unnecessary new keyword.

line 55 col 16: Unnecessary new keyword.

Fix lib/src/actions.dart. (-2.96 points)

Analysis of lib/src/actions.dart reported 6 hints, including:

line 19 col 7: Unnecessary new keyword.

line 22 col 7: Unnecessary new keyword.

line 25 col 7: Unnecessary new keyword.

line 28 col 7: Unnecessary new keyword.

line 31 col 7: Unnecessary new keyword.

Fix lib/src/middleware.dart. (-0.50 points)

Analysis of lib/src/middleware.dart reported 1 hint:

line 35 col 21: Unnecessary new keyword.

Fix lib/src/state.dart. (-0.50 points)

Analysis of lib/src/state.dart reported 1 hint:

line 46 col 12: Unnecessary new keyword.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and redux_dev_tools.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
redux >=4.0.0 <5.0.0 4.0.0
Dev dependencies
coverage >=0.13.0 <0.14.0
test >=1.0.0 <2.0.0