const App = (props) => {
var [count, setCount] = React.useState(0)
return (
const privateKey = Symbol('secret') | |
class SymbolPrivate { | |
constructor() { | |
this[privateKey] = 'SECRET' | |
this.publicKey = 42 | |
} | |
get privateKey() { | |
return this[privateKey] | |
} |
export default class IdlePromise { | |
static duration = Symbol('Next yield duration') | |
static onUrgent = Symbol('Callbacks when finish()') | |
static padding = 1 | |
promise = new Promise((resolve, reject) => { | |
this.resolve = resolve | |
this.reject = reject | |
}) | |
then = this.promise.then.bind(this.promise) |
/** | |
* | |
* Implementation of median angle function | |
* A More Efficient Way Of Obtaining A Unique Median Estimate For Circular Data | |
* 2003 / B. Sango Otieno & Christine M. Anderson-Cook | |
* from the annexes in https://digitalcommons.wayne.edu/cgi/viewcontent.cgi?referer=&httpsredir=1&article=1738&context=jmasm | |
* | |
*/ | |
/** |
const nbColumns = 5 | |
const nbRows = 5 | |
const matrix = new Array(nbColumns) | |
.fill(null) | |
.map(() => new Array(nbRows) | |
.fill(null) | |
.map(() => 0) | |
) |
export default function (matrix, start, goal) { | |
return aStar( | |
matrix, | |
start, | |
goal, | |
(cell) => heuristic(cell, goal), | |
distance, | |
) | |
} |
const nothing = new Proxy(Object.freeze(Object.create(null)), Object.create(null, { | |
get: { value(target, property) { | |
return property === Symbol.toPrimitive ? () => null : nothing } | |
} | |
})) | |
nothing.foo === nothing // true | |
nothing.foo.bar.baz[42].qux // nothing forever | |
typeof nothing === "object" // true |
// last reliably fired event before a user leaves | |
document.addEventListener('visibilitychange', () => { | |
if (document.visibilityState === 'hidden') { | |
// queues up a request to be sent even if the user leaves | |
navigator.sendBeacon('/log', analyticsData) | |
} | |
}) |
const App = (props) => {
var [count, setCount] = React.useState(0)
return (
{ | |
"scripts": [], | |
"styles": [], | |
"showConsole": true | |
} |
export const NON_SPACING_MARKS = new Set(['\u0300', '\u0301', '\u0302', '\u0303', '\u0304', '\u0305', '\u0306', '\u0307', '\u0308', '\u0309', '\u030A', '\u030B', '\u030C', '\u030D', '\u030E', '\u030F', '\u0310', '\u0311', '\u0312', '\u0313', '\u0314', '\u0315', '\u0316', '\u0317', '\u0318', '\u0319', '\u031A', '\u031B', '\u031C', '\u031D', '\u031E', '\u031F', '\u0320', '\u0321', '\u0322', '\u0323', '\u0324', '\u0325', '\u0326', '\u0327', '\u0328', '\u0329', '\u032A', '\u032B', '\u032C', '\u032D', '\u032E', '\u032F', '\u0330', '\u0331', '\u0332', '\u0333', '\u0334', '\u0335', '\u0336', '\u0337', '\u0338', '\u0339', '\u033A', '\u033B', '\u033C', '\u033D', '\u033E', '\u033F', '\u0340', '\u0341', '\u0342', '\u0343', '\u0344', '\u0345', '\u0346', '\u0347', '\u0348', '\u0349', '\u034A', '\u034B', '\u034C', '\u034D', '\u034E', '\u034F', '\u0350', '\u0351', '\u0352', '\u0353', '\u0354', '\u0355', '\u0356', '\u0357', '\u0358', '\u0359', '\u035A', '\u035B', '\u035C', '\u035D', '\u035E', '\u035F', '\u0360', '\u0361', '\ |