TypeScript
Destructuring

by Benny Neugebauer

case CONVERSATION_EVENT.MESSAGE_TIMER_UPDATE: {
  const {data: {message_timer: expireInMillis}, conversation} = data as ConversationMessageTimerUpdateEvent;
  this.service.conversation.setConversationLevelTimer(conversation, Number(expireInMillis));
  this.emit(Account.INCOMING.MESSAGE_TIMER_UPDATE, event);
  break;
}

case CONVERSATION_EVENT.MESSAGE_TIMER_UPDATE: {
  const timerUpdate = data as ConversationMessageTimerUpdateEvent;
  const expireInMillis = Number(timerUpdate.data.message_timer);
  this.service.conversation.setConversationLevelTimer(timerUpdate.conversation, expireInMillis);
  this.emit(Account.INCOMING.MESSAGE_TIMER_UPDATE, event);
  break;
}