JSFiddle - React, Tailwind, and code Playground

by joplomacedo

JavaScript

const GameHandlerClassFactory = {
	build(League) {
		 return class GameHandler {
			constructor( running_game ) {
				return new _GameHandler(League, running_game);
			}
		}
	}
}


class _GameHandler {
    constructor( League, running_game ) {
		this.League = League;
    }
	
	print() {
		console.log(this.League)
	}
}


GH = GameHandlerClassFactory.build('theleague');
gh = new GH()
gh.print()