export default class SparkBunEvent<DataType, ResponseType> {
	name: string;
	data: DataType;
	_response: ResponseType | undefined;
	responseWasSet: boolean = false;

	constructor(name: string, data: DataType) {
		this.name = name;
		this.data = data;
	}

	// Getter for response
	get response(): ResponseType | undefined {
		return this._response;
	}

	// Setter for response
	set response(value: ResponseType) {
		this._response = value;
		this.responseWasSet = true; // Update flag when response is set
	}

	clearResponse() {
		this._response = undefined;
		this.responseWasSet = false;
	}
}
