akiroz
1 min readDec 30, 2018

--

Thanks for the tip! Yes, I'm aware you can write JS in a high-level style as well. The snippet in question would probably look something like this:

function comfirmLeave(db) {

if(!Object.values(db.shotTransientStates).every(s => s.saved)) {

return ‘This page contains unsaved data, sure you want to leave?’;

}

return null;

}

Thinking back now, it probably wasn't that great of an example since both

`vals` and `every?` have JS equivalents.

--

--

akiroz

Electronics / Software Engineer — Eagle • Mbed • Nix • Arch • OS X • TS • Clojure • React • Postgres