MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / claim

Method claim

modules/io/dnssd/dnssd.js:82–97  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

80 return true;
81 }
82 claim(options) {
83 if (this.claims.some(claim => claim.host === options.host))
84 throw new Error("duplicate");
85
86 const claim = {
87 host: options.host,
88 hostLower: options.host.toLowerCase(),
89 onReady: options.onReady,
90 onError: options.onError,
91 probing: 1,
92 initial: Timer.set(() => this.probe(claim), 0),
93 probeAttempt: 1,
94 };
95 this.claims.push(claim);
96 return claim;
97 }
98 unclaim(claim) {
99 const i = this.claims.indexOf(claim);
100 if (i < 0)

Callers

nothing calls this directly

Calls 3

probeMethod · 0.95
setMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected