title: how to reference typeahead and bloodhound when loading npm typeahead.js
body: <p>I have installed typeahead.js using npm. From what I read this includes typeahead AND bloodhound.</p>
  
  <p>Then I require it after requiring jquery in my module.</p>
  
  <p>But now when I call</p>
  
  <pre><code>new Bloodhound()
  </code></pre>
  
  <p>Bloodhound is (understandably) undefined.</p>
  
  <p>I can find only examples including bloodhound.js and typeahead.js separately in script-files in html.</p>
  
  <p>How can this be done by requiring from npm?</p>
  
  <p>Just in case: here is my complete module:</p>
  
  <p>/*
       * gets all objects
       * builds an array of objects needed by the filter component to create the list of filterable objects
       * returns the filter component
       */
      'use strict'</p>
  
  <pre><code>import $ from 'jquery'
  import React from 'react'
  import 'typeahead.js'
  
  export default React.createClass({
    displayName: 'Filter',
  
    propTypes: {
      data: React.PropTypes.arrayOf(React.PropTypes.object).isRequired
    },
  
    componentDidMount () {
      const objects = this.props.data
        .map(function (object) {
          // make sure every fauna has a name
          // dont use others for filtering
          if (object.Taxonomie &amp;&amp; object.Taxonomie.Eigenschaften &amp;&amp; object.Taxonomie.Eigenschaften['Artname vollständig']) {
            return {
              id: object._id,
              label: object.Taxonomie.Eigenschaften['Artname vollständig']
            }
          }
        })
      const fauna = new Bloodhound({
          datumTokenizer: Bloodhound.tokenizers.whitespace('label'),
          queryTokenizer: Bloodhound.tokenizers.whitespace,
          local: objects
        })
      $('#bloodhound .typeahead').typeahead({
        minLength: 3,
        highlight: true
      },
      {
        name: 'fauna',
        valueKey: 'label',
        limit: 20,
        source: fauna
      })
    },
  
    render () {
      return (
        &lt;div id='bloodhound'&gt;
          &lt;input className='typeahead' type='text' placeholder='filtern'/&gt;
        &lt;/div&gt;
      )
    }
  })
  </code></pre>