DEV Community

Discussion on: Javascript pattern that changed everything (for me...)

Collapse
 
drewtownchi profile image
Drew Town

After reading this I realized that this is more or less the pattern the Vue function API proposal is using with some framework specific stuff sprinkled in. I didn't know that 😊

One thing that comes up in their examples is that you can use destructuring to get those methods/values out of the function to use them directly.

const { start, increment, count } = myRevelaingModule;

Cheers and thanks for the article.

Collapse
 
kristijanfistrek profile image
KristijanFištrek

Didn't know that! 😮
Unfortunately I am out of Vue world, although I hear its amazing and I should jump aboard, but I do know that several jQuery plugins and certain Angular functionalities use this or similar techniques to ensure encapsulation of their data.🙃
I would definitely recommend Addy Osmani Javascript Design Patterns to everyone interested in this kind of stuff ^