paint-brush
Singleton Pattern in ES6: The Good, The Bad, The Uglyby@wagslane
8,519 reads
8,519 reads

Singleton Pattern in ES6: The Good, The Bad, The Ugly

by Lane Wagner2mJune 20th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Singleton Pattern in ES6: The Good, The Bad, The Ugly. A singleton is a class that allows only a single instance of itself to be created and gives access to that created instance. It only instantiates a singleton once, and therefore any code that accesses the singleton will either create a new instance or modify that instance. Singletons are dangerously close to being a global variable, and we don't like those. Redux, vuex, singletons and globals all suck to varying degrees.

People Mentioned

Mention Thumbnail

Company Mentioned

Mention Thumbnail
featured image - Singleton Pattern in ES6: The Good, The Bad, The Ugly
Lane Wagner HackerNoon profile picture
Lane Wagner

Lane Wagner

@wagslane

Founder of Boot.dev. Whining about coding sins since 2011. Committing coding sins for the same.

About @wagslane
LEARN MORE ABOUT @WAGSLANE'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Lane Wagner HackerNoon profile picture
Lane Wagner@wagslane
Founder of Boot.dev. Whining about coding sins since 2011. Committing coding sins for the same.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here