Singleton Pattern in ES6: The Good, The Bad, The Uglyby@wagslane
7,873 reads

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

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

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

@wagslane

Lane Wagner


Receive Stories from @wagslane

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa