UNPKG

simulado

Version:
23 lines (17 loc) 307 B
let instance; class PortStore { constructor(portNumber = 7001) { if (!instance) { this.state = { port: portNumber }; instance = this; } return instance; } getState() { return this.state; } _removeInstance() { instance = null; } } module.exports = PortStore;