Add an optional onChanged() callback.