export class EventType { // we have to refer to the type `Payload`, otherwise ts will have weird behaviors // @see https://github.com/Microsoft/TypeScript/issues/20300 payload: Payload | undefined; symbol: symbol; // don't use the description in symbol, to keep the structure extendable constructor(public description: string = '') { this.symbol = Symbol(); // symbol 加上 description 方便调试 if (process.env.NODE_ENV === 'development') { this.symbol = Symbol(description); } } }