DEV Community

Discussion on: Simplify your Node code with Continuation Local Storage variables

Collapse
 
miketalbot profile image
Mike Talbot ⭐ • Edited

Agreed it's one of those things that's "interesting" until you really get it. In my real app we basically have a phase of decorating CLS with data and closure functions that know who the user is etc. Then all of our updating of audit logs is:

     function whoKnowsHowIGotHere(param) {
           cls.audit("gotHere", {param});
     }