JavaScript Strategy Context Class

Descripción

Context class that uses a strategy


File Template: ✅


Prefix

strategy:context


Scopes

javascript


Snippet de código

class ${1:Context} {
	constructor(strategy) {
		this._strategy = strategy;
	}

	setStrategy(strategy) {
		this._strategy = strategy;
	}

	executeStrategy() {
		this._strategy.execute();
	}
}

export default ${1:Context};