code: function setFromOpts(state, opts, key, defaultValue) {
  	var optsVal = opts[key];
  
  	if (optsVal) {
  		state[key] = optsVal;
  	} else {
  		state[key] = defaultValue;
  	}
  }
docs: Extract values from an option object and apply them
  to a state (or use a default value otherwise)
  
  @param {*} state
  @param {*} opts
  @param {*} key
  @param {*} defaultValue