Skip to content

Commit

Permalink
Rename changed to changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsenko committed Jan 25, 2022
1 parent 4dd5320 commit d00dd12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/src/native/realm_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class _RealmCore {
});
}

Stream<RealmObjectChanges> realmObjectChanged(RealmObject object, SchedulerHandle scheduler) {
Stream<RealmObjectChanges> realmObjectChanges(RealmObject object, SchedulerHandle scheduler) {
late StreamController<RealmObjectChanges> controller;

void callback(Pointer<Void> data) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/realm_object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class RealmObject {
}

// TODO: Should we generate this as a Stream<ObjectChanges<T>> on each realm object class?
Stream<ObjectChanges> get changed => realmCore.realmObjectChanged(this, realm!.scheduler.handle).map((o) => ObjectChanges(this, o));
Stream<ObjectChanges> get changes => realmCore.realmObjectChanges(this, realm!.scheduler.handle).map((o) => ObjectChanges(this, o));
}

//RealmObject package internal members
Expand Down
4 changes: 2 additions & 2 deletions test/realm_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ Future<void> main([List<String>? args]) async {
}
});

test('RealmObject.changed', () async {
test('RealmObject.changes', () async {
var config = Configuration([Dog.schema, Person.schema]);
var realm = Realm(config);

Expand All @@ -838,7 +838,7 @@ Future<void> main([List<String>? args]) async {
final dog = Dog('Fido');
write(() => realm.add(dog));

final stream = dog.changed.asBroadcastStream();
final stream = dog.changes.asBroadcastStream();

var callbacks = 0;
final subscription = stream.listen((_) => ++callbacks);
Expand Down

0 comments on commit d00dd12

Please sign in to comment.