Published
Edited
Aug 23, 2019
Importers
Insert cell
md`# Log Tests`
Insert cell
colog = ({})
Insert cell
used = ({})
Insert cell
log = ([arc, raw]) => {
const cos = runes(arc)
const muted = runes(mute)
const overrides = runes(override)
// console.log('Muted & Overrides', { muted, mute, overrides, override })
const actives = cos
.map(el => {
Object.assign(used, {[el]: (used[el] || 0) + 1})
return el
})
.reduce((res, el) => (res && !(muted.indexOf(el) > -1)) || (overrides.indexOf(el) > -1), true)
if (actives) {
return (...vals) => {
console.log(arc, ...vals)

}
} else {
return () => {}
}
}
Insert cell
mute = '🇻🇨'
Insert cell
override = '🏵'
Insert cell
d = {
log`🏵🇻🇨`('testing', colog)
log`🏵`('Petel', colog)
log`🇻🇨`('French testing', colog)
log`🎮`('French testing', colog)
return 'do'
}
Insert cell
usage = md`#### Used Symbols

~~~md
${Object.entries(used)
.map(([el, count]) => (`${el} — Code Point: ${el.codePointAt(0)} — Used: ${count}`)).join('\n')}
~~~
`

Insert cell
withlog = (input) => {
if (input) {
const cos = runes(input)
console.log('dolog runes', cos)
if (cos.length) {
const relog = cos.reduce((acc, el) => ({...acc, [el]: true}), {})
Object.assign(colog, relog)
}
}
}
Insert cell
notlog = (input) => {
if (input) {
const cos = runes(input)
console.log('unlog runes', cos)
if (cos.length) {
const delog = cos.reduce((acc, el) => ({...acc, [el]: false}), {})
Object.assign(colog, delog)
}
}
}
Insert cell
unlog = ([input]) => {
if (input) {
const cos = runes(input)
console.log('unlog runes', cos)
if (cos.length) {
const delog = cos.reduce((acc, el) => ({...acc, [el]: false}), {})
Object.assign(colog, delog)
}
}
}
Insert cell
dolog = ([input]) => {
if (input) {
const cos = runes(input)
console.log('dolog runes', cos)
if (cos.length) {
const relog = cos.reduce((acc, el) => ({...acc, [el]: true}), {})
Object.assign(colog, relog)
}
}
}
Insert cell
runes = require('runes@0.4.3/index.js').catch(() => window["runes"])
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