Last active
December 22, 2017 14:07
-
-
Save Zhuinden/0ccd925a3728961d8cee43e10879628a to your computer and use it in GitHub Desktop.
Monarchy 1: live data + realm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LiveData<List<Dog>> results = monarchy.findAllMappedWithChanges( | |
realm -> realm.where(RealmDog.class), | |
realmDog -> Dog.create(realmDog.getName())); // `Dog` is immutable | |
results.observe(this, (dogs) -> { | |
adapter.updateData(dogs); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment