Skip to content

Commit

Permalink
fix(SearchBox): clean up eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
eyebraus committed Sep 6, 2015
1 parent e7a22cf commit 0803808
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/SearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class SearchBox extends Component {
// Controlled [props] - used in componentDidMount/componentDidUpdate
...searchBoxControlledPropTypes,
// Event [onEventName]
...searchBoxEventPropTypes
...searchBoxEventPropTypes,
}

// Public APIs
Expand Down Expand Up @@ -54,7 +54,7 @@ export default class SearchBox extends Component {

this.setState({
inputElement: domEl,
searchBox: searchBox
searchBox: searchBox,
});
}

Expand Down
10 changes: 5 additions & 5 deletions src/creators/SearchBoxCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import {default as componentLifecycleDecorator} from "../utils/componentLifecycl
import {default as GoogleMapHolder} from "./GoogleMapHolder";

export const searchBoxControlledPropTypes = {
bounds: PropTypes.any
bounds: PropTypes.any,
};

export const searchBoxDefaultPropTypes = defaultPropsCreator(searchBoxControlledPropTypes);

const searchBoxUpdaters = {
bounds (bounds, component) { component.getSearchBox().setBounds(bounds); }
bounds (bounds, component) { component.getSearchBox().setBounds(bounds); },
};

const {eventPropTypes, registerEvents} = eventHandlerCreator(SearchBoxEventList);
Expand All @@ -29,18 +29,18 @@ export const searchBoxEventPropTypes = eventPropTypes;
@componentLifecycleDecorator({
registerEvents,
instanceMethodName: "getSearchBox",
updaters: searchBoxUpdaters
updaters: searchBoxUpdaters,
})
export default class SearchBoxCreator extends Component {

static propTypes = {
mapHolderRef: PropTypes.instanceOf(GoogleMapHolder).isRequired,
searchBox: PropTypes.object.isRequired
searchBox: PropTypes.object.isRequired,
}

static _createSearchBox (inputElement, searchBoxProps) {
const searchBox = new google.maps.places.SearchBox(inputElement, composeOptions(searchBoxProps, [
"bounds"
"bounds",
]));

return searchBox;
Expand Down
2 changes: 1 addition & 1 deletion src/eventLists/SearchBoxEventList.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://developers.google.com/maps/documentation/javascript/3.exp/reference#SearchBox
// [].map.call($0.querySelectorAll("tr>td>code"), function(it){ return it.textContent; })
export default [
"places_changed"
"places_changed",
];
6 changes: 3 additions & 3 deletions src/utils/componentLifecycleDecorator.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function componentLifecycleDecorator ({registerEvents, instanceMe
writable: true,
value: function () {
// Hook into client's implementation, if it has any
if (componentDidMount !== null) {
if (null !== componentDidMount) {
componentDidMount.call(this);
}

Expand All @@ -47,7 +47,7 @@ export default function componentLifecycleDecorator ({registerEvents, instanceMe
}

// Hook into client's implementation, if it has any
if (componentDidUpdate !== null) {
if (null !== componentDidUpdate) {
componentDidUpdate.call(this, prevProps);
}

Expand All @@ -61,7 +61,7 @@ export default function componentLifecycleDecorator ({registerEvents, instanceMe
writable: true,
value () {
// Hook into client's implementation, if it has any
if (componentWillUnmount !== null) {
if (null !== componentWillUnmount) {
componentWillUnmount.call(this);
}

Expand Down

0 comments on commit 0803808

Please sign in to comment.