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.

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
akiroz

akiroz

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

More from Medium

The World of MVC

iOS App Architecture for Web Developers | LaptrinhX

Morning Journal 1/19/22

“The Letting Go of Torture”

A Day In My Alaskan Life