Published
Edited
Jan 11, 2019
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
//Logout button "Error Logging out" on terminal, spread the below over two cells.
// viewof b1 = button({value: "Logout", description: "We use a reference to the button below to trigger the logout."})
/*{
b1
if (this !== true) {
console.log( solidAuth.logout());
}
return !this;
} */
Insert cell
Insert cell
Insert cell
Insert cell
profileInput = {
let e = html`<input type="text" value="${targetWebId}" autofocus>`;
e.addEventListener("keyup", event => {
switch (event.key) {
case "Enter": mutable targetWebId = e.value; break;
}
});
return e;
}
Insert cell
Insert cell
loggedInProfileObj = {
//Observable seems to get the variable dependency tree confused if you define fetcher outside.
const fetcher = new $rdf.Fetcher(store);
const rdfPerson = await fetcher.load(targetWebId)
const fullName = store.any($rdf.sym(targetWebId), FOAF('name'))
const friends = store.each($rdf.sym(targetWebId), FOAF('knows'));

const loadedFriends = await Promise.all(
friends.map(async (friend) => {
try {
await fetcher.load(friend);
}
catch(err){
console.error(err);
}

return ({ ref: friend,
resolved: store.any(friend, FOAF('name'))});
})
);
return ({
dateRequested: new Date(Date.now()).toUTCString(),
rdfPerson,
fullName,
friends,
loadedFriends
})
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
/* This is the code to require mashlib, according to https://beta.observablehq.com/@tmcw/module-require-debugger*/
//mashlib = require('mashlib@0.7.17/index.js').catch(() => window.dump)
Insert cell
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