OptionalcustomObserver subclass to instantiate instead of the default GradumObserver.
OptionaldepthHow many levels below the attached path to watch. Defaults to the depth implied by the key path the observer is registered on.
OptionalinitializeIf true, the observer is initialized on creation, so it immediately
reports every entry already present.
OptionalonCalled when a change is reported at a key path with no instance yet. Return an instance to have it stored and handed back to later callbacks.
OptionalonCalled when an entry that already has an instance changes.
OptionalonCalled when an entry is removed.
OptionalreplaceCalled before onUpdated. Return true to destroy the existing instance and create a fresh one through
onAdded instead of updating it in place.
OptionalonCalled when the observer is initialized.
OptionalonCalled when the observer is destroyed.
Description
Options and lifecycle callbacks used to create a new GradumObserver. Note:
selfis the second argument ofonAddedbut the third ofonUpdatedandonDeleted, which take the existing instance in second place.