Skip to content

Instantly share code, notes, and snippets.

@Zhuinden
Last active December 22, 2017 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zhuinden/0ccd925a3728961d8cee43e10879628a to your computer and use it in GitHub Desktop.
Save Zhuinden/0ccd925a3728961d8cee43e10879628a to your computer and use it in GitHub Desktop.
Monarchy 1: live data + realm
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