 
   componentDidMount: =>
     $(document).on 'beatmap:load_more.beatmaps', @loadMore
-    $(document).on 'beatmap:search:start.beatmaps', @search
+    $(document).on 'beatmap:search:start.beatmaps', @debouncedSearch
     $(document).on 'beatmap:search:filtered.beatmaps', @updateFilters
     $(document).on 'turbolinks:before-cache.beatmaps', @saveState
     $(window).on 'resize.beatmaps', @updateColumnCount

  constructor: (props) ->
    super props

    prevState = JSON.parse(props.container.dataset.reactState ? '{}')

    @state = prevState.state unless _.isEmpty(prevState)

    return if _.isEqual(prevState.filters, @state.filters)

    $(document).trigger 'beatmap:search:start'


  componentWillUnmount: =>
    $(document).off '.beatmaps'
    $(window).off '.beatmaps'
    @debouncedSearch.cancel
    @xhr?.abort()


