src code

instance method Spah.State#apply

Spah.State#apply(query, ruleFunc) → Spah.State

query (String): A SpahQL query limiting the results against which the rule will be run. ruleFunc (Function): A function to be applied to all matching SpahQL results. Takes an individual QueryResult as the only argument.

Applies the given function to all matches for the given SpahQL query, leaving this instance unchanged and returning a new Spah.State instance with the changes applied.