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

Method resolve

www/js/_hyperscript.esm.js:8090–8116  ·  view source on GitHub ↗
(context, { on, time, evt, from, classRef, classRef2, classRefs, betweenValues })

Source from the content-addressed store, hash-verified

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