The way I'd do this is:

```js
this.prototype.state = function (state, value) {
  if (arguments.length === 1) return this._state[state];
  if (this._state[state] === value) return this;

  this._state[state] = value;
  if (this.$el && this.$el.state) this.$el.state(state, value);
  this.trigger('change:state:'+state, this, value);
  this.trigger('change:state', this, state, value);
  return this;
}
```

To eliminate the big conditional wrapping.