Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

singleton CLASS IN JS

"use strict";
// require the events and the instance
const Events = require("events");

const events = new Events();




module.exports = events;
// Then require this instance in differnt file
// const events = require("./file-contain-the-singlton-class");
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #singleton #CLASS #IN #JS
ADD COMMENT
Topic
Name
7+3 =