redux_heaven 0.1.0 copy "redux_heaven: ^0.1.0" to clipboard
redux_heaven: ^0.1.0 copied to clipboard

discontinued

A collection of utilities for development with Redux.

redux_heaven #

A package of simple utilities for development with Redux.

It helps you write Redux boilerplate comfortably & cleanly.

This package is fully inspired from Redux.dart.

This package is ported from another own packages redux_types & injectable_middleware.

ReducerOf & MiddlewareOf #

These are more cleaned type matching classes for Redux than TypedReducer & TypedMiddleware of Redux.dart. You can comfortably write type matching classes with IDE support like Android Studio.

  • ReducerOf - A Reducer class for type matching. It's better to write & read with IDE support.
  • MiddlewareOf - A Middleware class for type matching. It's better to write & read with IDE support.

Dependencies #

Usage #

Demonstrate how to use redux_types.

ReducerOf #

final Reducer<AppState> appReducer = combineReducers(
  [
    /// An example of using [ReducerOf]. It provides you
    /// an ease of writing by IDE support and readability.
    ReducerOf<AppState, IncrementAction>(
      callback: (state, action) {
        return state.copyWith(
          counter: state.counter + 1,
        );
      },
    ),
  ],
);

MiddlewareOf #

List<Middleware<AppState>> counterMiddleware() {
  return [
    /// An example of using [MiddlewareOf]. It provides you
    /// an ease of writing by IDE support and readability.
    MiddlewareOf<AppState, IncrementAction>(
      callback: (store, action, next) {
        print('IncrementAction was called!');
        next(action);
      },
    ),
  ];
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A collection of utilities for development with Redux.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

meta, redux

More

Packages that depend on redux_heaven