angular_redux 1.3.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 61

angular_redux.dart #

Bindings between Redux and Angular Dart.

Quick Start #

Create a factory for your Store:

class CounterStoreFactory {
  static Store<CounterState> createStore(/* ... */) {
    return Store(/* ... */); 
  }
}

Use FactoryProvider to make the Store injectable:

@Component(
  /* ... */
  providers: [
    /* ... */
    FactoryProvider(Store, CounterStoreFactory.createStore)
  ],
)
class CounterAppComponent {
  /* ... */
}

Extend base SelectPipe to specify the State type:

@Pipe('select', pure: false)
class CounterSelectPipe extends SelectPipe<CounterState> {
  CounterSelectPipe(Store<CounterState> store, ChangeDetectorRef detector) : super(store, detector);
}

Use this pipe in your components:

@Component(
  /* ... */
  pipes: [
    CounterSelectPipe,
  ],
)
class CounterAppComponent {
  /* ... */
}

Add a selector method in the component to select a value from the Store:

class CounterAppComponent {
  /* ... */

  int getCount(CounterState state) => state.count;
}

Use select pipe in Angular templates to extract a value from the Store:

<div>
  {{ getCount | select }}
</div>

Component will be marked for check automatically when the State changes and the selector returns new value.

1.3.0 #

  • Add optional comparer

1.2.2 #

  • Use selector in SelectPipe example

1.2.1 #

  • Add SelectPipe example

1.2.0 #

  • Add SelectPipe

1.1.3 #

  • Add documentation

1.1.2 #

  • Add documentation

1.1.1 #

  • Add documentation

1.1.0 #

  • Add documentation

1.0.0 #

  • Initial release

example/main.dart

import 'package:angular/angular.dart';
import 'components/counter_app.template.dart' as ng;

void main() {
  runApp(ng.CounterAppComponentNgFactory);
}

Use this package as a library

1. Depend on it

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


dependencies:
  angular_redux: ^1.3.0

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

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

  • Dart: 2.8.2
  • pana: 0.13.8-dev

Health suggestions

Format lib/src/select_pipe.dart.

Run dartfmt to format lib/src/select_pipe.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
angular >=4.0.0 <6.0.0 5.3.1 6.0.0-alpha+1
redux >=3.0.0 <5.0.0 4.0.0
Transitive dependencies
analyzer 0.35.4 0.39.8
angular_ast 0.5.9 0.5.11
angular_compiler 0.4.3 0.4.5
args 1.6.0
async 2.4.1
build 1.3.0
build_config 0.4.2
built_collection 4.3.2
built_value 7.1.0
charcode 1.1.3
checked_yaml 1.0.2
code_builder 3.3.0
collection 1.14.12
convert 2.1.1
crypto 2.1.5
csslib 0.14.6+1 0.16.1
dart_style 1.2.4 1.3.6
fixnum 0.10.11
front_end 0.1.14 0.1.29
glob 1.2.0
intl 0.15.8 0.16.1
js 0.6.1+1
json_annotation 3.0.1
kernel 0.3.14 0.3.29
logging 0.11.4
matcher 0.12.6
meta 1.1.8
node_interop 1.1.1
node_io 1.1.1
package_config 1.9.3
path 1.7.0
pub_semver 1.4.4
pubspec_parse 0.1.5
quiver 2.1.3
source_gen 0.9.4+4 0.9.5
source_span 1.7.0
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+15
yaml 2.2.1
Dev dependencies
build_runner ^1.5.1
build_web_compilers ^2.1.0
pedantic >=1.8.0+1 <2.0.0 1.9.0
reselect ^0.4.0