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
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 thatgo
loops generate a lot of garbage, and all of these loops can be condensed to a singlego
loop that dispatches viaalt!
.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:
take!
on line 60 instead of ago
block for efficiency.loading-view
is not supplied (bootstrap)class-name
option was not implemented (bootstrap)Thanks! -Josh