Skip to content

Instantly share code, notes, and snippets.

@nobodyiam
Created July 6, 2016 14:32
Show Gist options
  • Save nobodyiam/723aa16ea33f552f794806c5f62648b5 to your computer and use it in GitHub Desktop.
Save nobodyiam/723aa16ea33f552f794806c5f62648b5 to your computer and use it in GitHub Desktop.
Apollo client change listener
Config config = ConfigService.getAppConfig();
config.addChangeListener(new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
for (String key : changeEvent.changedKeys()) {
ConfigChange change = changeEvent.getChange(key);
System.out.println(String.format(
"Found change - key: %s, oldValue: %s, newValue: %s, changeType: %s",
change.getPropertyName(), change.getOldValue(),
change.getNewValue(), change.getChangeType()));
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment