title: Twitter Typeahead: Upgrading to the latest version using the same function
body: <p>I'm currently using the Bootstrap-typeahead plugin, this way:</p>
  
  <pre><code>$('.patients_typeahead').typeahead({
                      name: 'patientshomepage',
                      source: function (query, process) {
                          $.ajax({
                              url: 'source.php',
                              type: 'POST',
                              query: 'query=' + query,
                              dataType: 'JSON',
                              async: true,
                              success: function (data) {
                                 process(data);
                              }
  
                          })
                      }
  
  
  
                  });
  </code></pre>
  
  <p>I want to upgrade to the latest typeahead, but I understood that the <code>source: function()</code> isn't supported anymore. How can I convert my code so I could use the latest twitter-typeahead?</p>