src code

instance method Spah.SpahQL.QueryResult#modified

Spah.SpahQL.QueryResult#modified(pathOrCallback[, callback]) → void
  • pathOrCallback (Function, String): The path relative to this result to which you want to bind the listener.
  • callback (Function): If pathOrCallback is given as a string, this second argument should be the callback function.

Registers a callback to be triggered when data within this path (including descendants of this path) is modified on the object from which this query result was generated. The callback is not bound to this particular result instance, but instead registered on the Spah.SpahQL.Callbacks module.

Upon modification, the callback will be triggered with arguments path (the path of the modified data), and result (a QueryResult representing the newly-modified value). The result argument may be undefined if the data at that path was removed during the modification.