@@ -4,6 +4,14 @@ import 'package:meta/meta.dart';
4
4
import 'package:flutter/widgets.dart' hide Builder;
5
5
import 'package:built_redux/built_redux.dart' ;
6
6
7
+ /// [Connect] maps state from the store to the local state that a give
8
+ /// component cares about
9
+ typedef LocalState Connect <StoreState , LocalState >(StoreState state);
10
+
11
+ /// [WidgetBuilder] returns a widget given context, local state, and actions
12
+ typedef Widget WidgetBuilder <LocalState , Actions extends ReduxActions >(
13
+ BuildContext context, LocalState state, Actions actions);
14
+
7
15
/// [StoreConnection] is a widget that rebuilds when the redux store
8
16
/// has triggered and the connect function yields a new result. It is an implementation
9
17
/// of `StoreConnector` that takes a connect function and builder function as parameters
@@ -24,9 +32,8 @@ import 'package:built_redux/built_redux.dart';
24
32
/// [LocalState] should be comparable. It is recommended to only use primitive or built types.
25
33
class StoreConnection <StoreState , Actions extends ReduxActions , LocalState >
26
34
extends StoreConnector <StoreState , Actions , LocalState > {
27
- final LocalState Function (StoreState state) _connect;
28
- final Widget Function (BuildContext context, LocalState state, Actions actions)
29
- _builder;
35
+ final Connect <StoreState , LocalState > _connect;
36
+ final WidgetBuilder <LocalState , Actions > _builder;
30
37
31
38
StoreConnection ({
32
39
@required LocalState connect (StoreState state),
0 commit comments