Repository navigation
Include places in filter auto-suggest - #45
Conversation
- Simplify iconMap implementation - Remove escaping of quotation mark
8480f51 to
9e6d342
Compare
|
|
||
| getHeatmapTiles(fromDate, toDate, zoomLevel, maintopic, tileid, periodType, | ||
| dataSource, externalsourceid, conjunctivetopics, callback) { | ||
| console.log(`processing tile request [${maintopic}, ${fromDate}, ${toDate}, ${tileid}}]`) |
There was a problem hiding this comment.
can we leave this in for the moment as I depend on this for monitoring / debugging. this will be removed before we go live.
There was a problem hiding this comment.
This creates a lot of noise and makes other debugging harder... but sure. 84969b0
| suggestions={suggestions} | ||
| inputProps={inputProps} | ||
| focusInputOnSuggestionClick={true} | ||
| onSuggestionSelected={this.onSuggestionSelected} |
There was a problem hiding this comment.
Agree that this should be there but you forgot to bind onSuggestionSelected to the component in the constructor.
There was a problem hiding this comment.
This is not necessary given that the function now is an arrow function. You can learn more about how this works in this article (see "Approach 5: Arrow Function in Class Property").
It's much neater to use the arrow-function approach over the explicit bind approach (no duplicate code and potential to forget to bind the function) and it doesn't suffer from the performance overhead of re-declaring arrow function in the render method (this will cause a re-render of the component on every cycle since React has no way of knowing that the arrow function declared in render always is the same).
| <div style={styles.searchBox}> | ||
| { <TypeaheadSearch | ||
| dashboardRefreshFunc={(maintopic, conjunctivetopics)=>this.handleDataFetch(maintopic, conjunctivetopics)} | ||
| dashboardRefreshFunc={this.handleDataFetch} |
There was a problem hiding this comment.
bind handleDataFetch
There was a problem hiding this comment.
This is not necessary given that the function now is an arrow function. You can learn more about how this works in this article (see "Approach 5: Arrow Function in Class Property").
It's much neater to use the arrow-function approach over the explicit bind approach (no duplicate code and potential to forget to bind the function) and it doesn't suffer from the performance overhead of re-declaring arrow function in the render method (this will cause a re-render of the component on every cycle since React has no way of knowing that the arrow function declared in render always is the same).
| 'Term': 'fa fa-tag fa-2x', | ||
| }; | ||
|
|
||
| function fetchLocationsFromFeatureService(bbox, matchName, callback) { |
There was a problem hiding this comment.
can you move this function under the services folder
There was a problem hiding this comment.
This is a fairly specific function so there won't be much potential for re-using it, but sure. 9fece04
|
@erikschlegel NB: the arrow functions for binding work even on very old npm :) |

Searching for locations
Switching search dataset
Searching for topics
Close-up of styling