Fork me on GitHub

but why it works fine with non-minified js?


the issue appears only on minified source


not sure tbh. could be that some sort of dev-only code in React, Reagent or re-frame is obfuscating the issue


okay, I’ll dig a bit more


That's good to know.


How does one go about making effects for window events? say a gradient shift for the entire baground on mouse move?

Wilson Velez14:03:36

Hi, How to avoid multiples AJAX requests when a field change its state? I mean, if the user is typing a name I don’t want to search for every letter just at the end

Wilson Velez14:03:00

I found that cljs-ajax has a property :on-request where we can get request and then maybe we can cancel it

Wilson Velez14:03:58

or other option is to put a timeout to execute the request and cancel it if the field changes before the timeout expires


The latter is pretty close to what I use. On change, I fire an event that checks to see if there's a pending timeout, and if there is, cancel it and start a new timeout. When the timeout fires, it triggers an event that does the actual ajax call.

👍 4

See goog.functions.debounce

👍 8

You want to have a look at debounce and throttle :)

Wilson Velez14:04:34

Thanks @UE35Y835W, I read about throttle but I really didn’t get it, and it worked with debounce so I didn’t look too much, but thank you any way.