Skip to content

Commit d8f485a

Browse files
authored
Added UpdateEvent on ParseLiveList (#606)
1 parent 635c43e commit d8f485a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/dart/lib/src/utils/parse_live_list.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@ class ParseLiveList<T extends ParseObject> {
377377
oldObject: _list[i].object, paths: _includePaths);
378378
if (after(_list[i].object, object) == null) {
379379
_list[i].object = object.clone(object.toJson(full: true));
380+
_eventStreamController.sink.add(ParseLiveListUpdateEvent<T>(
381+
i, object.clone(object.toJson(full: true))));
380382
} else {
381383
_list.removeAt(i).dispose();
382384
_eventStreamController.sink.add(ParseLiveListDeleteEvent<T>(
@@ -742,6 +744,11 @@ class ParseLiveListAddEvent<T extends ParseObject>
742744
ParseLiveListAddEvent(int index, T object) : super(index, object);
743745
}
744746

747+
class ParseLiveListUpdateEvent<T extends ParseObject>
748+
extends ParseLiveListEvent<T> {
749+
ParseLiveListUpdateEvent(int index, T object) : super(index, object);
750+
}
751+
745752
class ParseLiveListDeleteEvent<T extends ParseObject>
746753
extends ParseLiveListEvent<T> {
747754
ParseLiveListDeleteEvent(int index, T object) : super(index, object);

0 commit comments

Comments
 (0)