TypeScript
Returning a Promise

by Benny Neugebauer

init(config: { [index: string]: any }): Promise<void> {
  this.lowerThreshold = config.lowerThreshold;
  this.upperThreshold = config.upperThreshold;
  return Promise.resolve();
}

async init(config: { [index: string]: any }): Promise<void> {
  this.lowerThreshold = config.lowerThreshold;
  this.upperThreshold = config.upperThreshold;
}