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

Method resolve

www/js/_hyperscript-max.js:8091–8117  ·  view source on GitHub ↗
(context, { on, time, evt, from, classRef, classRef2, classRefs, betweenValues })

Source from the content-addressed store, hash-verified

8089 }
8090 }
8091 resolve(context, { on, time, evt, from, classRef, classRef2, classRefs, betweenValues }) {
8092 if (time) {
8093 return new Promise((resolve) => {
8094 this.toggle(context, on, classRef, classRef2, classRefs, betweenValues);
8095 setTimeout(() => {
8096 this.toggle(context, on, classRef, classRef2, classRefs, betweenValues);
8097 resolve(this.findNext(context));
8098 }, time);
8099 });
8100 } else if (evt) {
8101 return new Promise((resolve) => {
8102 var target = from || context.me;
8103 target.addEventListener(
8104 evt,
8105 () => {
8106 this.toggle(context, on, classRef, classRef2, classRefs, betweenValues);
8107 resolve(this.findNext(context));
8108 },
8109 { once: true }
8110 );
8111 this.toggle(context, on, classRef, classRef2, classRefs, betweenValues);
8112 });
8113 } else {
8114 this.toggle(context, on, classRef, classRef2, classRefs, betweenValues);
8115 return this.findNext(context);
8116 }
8117 }
8118 };
8119 var HideCommand = class _HideCommand extends VisibilityCommand {
8120 static keyword = "hide";

Callers

nothing calls this directly

Calls 3

toggleMethod · 0.95
setTimeoutFunction · 0.50
findNextMethod · 0.45

Tested by

no test coverage detected