A Function Should Know Where It Runs
·8 min read
·
0 reactions
·
0 comments
·
4 views
There is an obvious appeal to a server function you can call from anywhere. The old version of the...
Original article
DEV.to (Top)
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 1115191) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Viktor Lázár Posted on Apr 30 A Function Should Know Where It Runs #webdev #architecture #api #javascript There is an obvious appeal to a server function you can call from anywhere. The old version of the same idea was not pleasant.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).
Anonymous · no account needed