function setState(update) {
  if (typeof update === 'string') {
    this.state = update;
  } else if (this.state === null) {
    this.state = update;
  } else {
    Object.assign(this.state, update);
  }
}
@description Merge a given state with the current state.
@param {object} update - Object to merge in the state.
@example
store.setState({
  alarm: 'disarmed',
});