Published
Edited
May 19, 2020
Importers
Insert cell
Insert cell
buildClient = function() {
const search = util.urlSearch();
const params = ['ssl', 'host', 'port', 'path', 'alert', 'key'].reduce(
(acc, v) => {
acc[v] = search.get(v);
return acc;
},
{}
);
const { ssl, host, port, path } = params;
if (!(host && port && path))
return 'Missing host or port or path in url params';
return b.buildClient({ server: { host, port, path } });
}
Insert cell
util = ({
urlSearch: () => new URLSearchParams(window.location.search),
buildTimestamp: () =>
new Date()
.toISOString()
.slice(11, -1)
.replace(/:|\./g, '_'),
logJson: data => console.log(`data --> ${JSON.stringify(data, null, 2)}`)
})
Insert cell
b = require(await FileAttachment('index.js').url())
Insert cell
// after npm publish
// jb = require("https://cdn.jsdelivr.net/@oscar6echo/job-client-graphql.js")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more