Skip to content

Commit

Permalink
Reselect in example alibaba#525
Browse files Browse the repository at this point in the history
  • Loading branch information
zjuwjf committed Nov 12, 2019
1 parent fdc80a8 commit bf81f09
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions example/lib/todo_list_page/state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,18 @@ PageState initState(Map<String, dynamic> args) {
return PageState();
}

class ReportConnector extends Reselect2<PageState, ReportState, int, int> {
class ReportConnector extends ConnOp<PageState, ReportState>
with ReselectMixin<PageState, ReportState> {
@override
ReportState computed(int sub0, int sub1) {
ReportState computed(PageState state) {
return ReportState()
..done = sub0
..total = sub1;
..done = state.toDos.where((ToDoState tds) => tds.isDone).length
..total = state.toDos.length;
}

@override
int getSub0(PageState state) {
return state.toDos.where((ToDoState tds) => tds.isDone).toList().length;
}

@override
int getSub1(PageState state) {
return state.toDos.length;
List<dynamic> factors(PageState state) {
return state.toDos;
}

@override
Expand Down

0 comments on commit bf81f09

Please sign in to comment.