Fork me on GitHub
Oliver George11:09:36

I'm looking for a way to avoid my ajax auto-complete glitching.

Oliver George11:09:45

As I type, new ajax requests fetch data.

Oliver George11:09:56

That means there's a period where no results are available.

Oliver George11:09:33

Seems a bit clunky.

Oliver George11:09:59

The behaviour I'd like is "keep showing the old list while I'm fetching new results"

Oliver George11:09:52

I'm doing a deal with the devil for now. Should be fine in my use case...

     (fn [_ _ [_ props]]
       (not (:loading props)))


I don't see the reason why would you need to display empty results set


there must me something cleaning the cache while next req is in-flight

Oliver George12:09:35

I use a sub for fetching results. The sub returns immediately with a loading state, then updates when values are available.


so you're replacing prev. results with loading state when req is issued?


why not have them side-by-side?


Is there something akin to re-frame but for server side programs? I have a huge service that handles websockets, message queues and relatively big global, dynamic state. I can see some benefits in re-writing it using re-frame concepts.


you mean core.async pubsub?


@nooga a CQRS architecture is one way of interpreting re-frame on the server