DEV Community

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

Collapse
 
rajajaganathan profile image
Raja Jaganathan

Many time come across CLS but didn't understand the use case but your article helps!. Thanks for writing!

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});
     }