arosequist/om-autocomplete — pull request #2 by jalehman (2014-08-09 20:26:17+00:00)
Title: Various bug fixes, updates, code restructuring

Hello!

I've been using this as a replacement for Twitter's typeahead.js, and have to say I'm really pleased with it. The API design has proven really nice to use and decomplected from what I've seen in other js-based typeaheads.

I've made a number of changes to the underlying implementation. Most notably, I noticed that you were using a separate `(go (loop [] ...))` for each internal channel. The problem with this is that `go` loops generate a lot of garbage, and all of these loops can be condensed to a single `go` loop that dispatches via `alt!`.

In addition, I found that breaking all of the inline logic contained within the `will-mount` protocol into separate functions greatly enhances readability.

In addition:

- Update to latest dependencies
- Use `take!` on line 60 instead of a `go` block for efficiency.
- Make the tab key also select highlighted result (bootstrap)
- Hide empty loading view when `loading-view` is not supplied (bootstrap)
- `class-name` option was not implemented (bootstrap)
- Some general formatting tweaks to reduce overall code size

Thanks!
-Josh