MCPcopy
hub / github.com/schn4ck/schnack / constructor

Method constructor

src/embed/client.js:9–25  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

7
8export default class Schnack {
9 constructor(options) {
10 this.options = options;
11 this.options.endpoint = `${options.host}/comments/${options.slug}`;
12 this.initialized = false;
13 this.firstLoad = true;
14
15 const url = new URL(options.host);
16
17 if (url.hostname !== 'localhost') {
18 document.domain = url.hostname
19 .split('.')
20 .slice(1)
21 .join('.');
22 }
23
24 this.refresh();
25 }
26
27 refresh() {
28 const { target, slug, host, endpoint, partials } = this.options;

Callers

nothing calls this directly

Calls 1

refreshMethod · 0.95

Tested by

no test coverage detected