code: function setState(state) {
      if (location) {
        updateLocationState(location, state);
        updateLocation(location);
      } else {
        updateLocationState(getCurrentLocation(), state);
      }
    }
docs: deprecated