incredux 0.1.2

incredux #

Created from templates made available by Stagehand under a BSD-style license.

Usage #

A simple usage example:

import 'package:redux/redux.dart';
import 'package:incredux/incredux.dart';

enum Actions { increment, decrement }

void main() {
  when(Actions.increment, (store) => print('(Increment) state: ${store.state}'));

  when( Actions.decrement, (store) => print('(Decrement) state: ${store.state}'));

  int counterReducer(int state, dynamic action) {
    if (action == Actions.increment) {
      return state + 1;
    } else if (action == Actions.decrement) {
      return state - 1;
    }

    return state;
  }

  var store = Store<int>(
    counterReducer,
    initialState: 0,
    middleware: <Middleware<int>>[
      incredux<int>()
    ],
  );

  store.dispatch(Actions.increment); // Print: `(Increment) state: 1`
  store.dispatch(Actions.decrement); // Print: `(Increment) state: 0` - because did call increment before
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1.0.0 #

  • Initial version, created by Stagehand

example/incredux_example.dart

import 'package:incredux/incredux.dart';

main() {}

Use this package as a library

1. Depend on it

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


dependencies:
  incredux: ^0.1.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:incredux/incredux.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
92
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:incredux/incredux.dart.

Health suggestions

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

Analysis of lib/src/middleware.dart reported 2 hints:

line 20 col 1: Prefer using /// for doc comments.

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

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

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

line 5 col 1: Prefer using /// for doc comments.

Maintenance suggestions

The package description is too short. (-8 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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
redux ^3.0.0 3.0.0
Dev dependencies
test ^1.0.0

Admin