MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / maybeNotify

Method maybeNotify

www/js/_hyperscript.esm.js:2500–2507  ·  view source on GitHub ↗

* Check if a method call is known to mutate its receiver, and notify if so. * @param {Object} target - The object the method was called on * @param {string} methodName - The method name

(target, methodName)

Source from the content-addressed store, hash-verified

2498 * @param {string} methodName - The method name
2499 */
2500 maybeNotify(target, methodName) {
2501 if (target == null || typeof target !== "object") return;
2502 var typeName = target.constructor && target.constructor.name;
2503 var methods = typeName && config.mutatingMethods[typeName];
2504 if (methods && methods.includes(methodName)) {
2505 this.notifyMutation(target);
2506 }
2507 }
2508 #trackMutation(val) {
2509 if (this.reactivity.isTracking && val != null && typeof val === "object") {
2510 this.reactivity.trackProperty(val, "__mutation__");

Callers 2

resolveMethod · 0.45
resolveMethod · 0.45

Calls 1

notifyMutationMethod · 0.95

Tested by

no test coverage detected