Fork me on GitHub

I have a swap! call inside of a callback that never happens. Help?


I have an atom counts that's supposed to be counting successful onload events. I set a callback function that logs the event, and then increments the counts atom. The logging happens, so I know the callback is running, but the swap! never does, so the counts never increment.


are atoms not useable inside async events like this somehow? that doesn't seem right.

Jakub Zika09:03:44

Hi, do you know about any CLJS library for OIDC? There is oidc-client for JS but I am not good in JS and its interop so I would prefer native CLJS library (which I cant find). Thanks a lot

Chris McCormick12:03:51

Does anybody know of a library that will take a <textarea> and return an atom, which when mutated will update the contents of the textarea? Kind of like how storage-atom will do the same for localstorage. I am building a Reagent UI on top of a Django admin form which has JSON blobs stored in text fields. Django handles the saving of the textareas so I want to make sure any changes the user makes to the structure of the blob in the UI are updated in the textbox for when they click 'save'.

Chris McCormick12:03:06

Wait a moment, I can just use reagent to re-render the textareas. facepalm

Chris McCormick12:03:15

Sorry for the noise.


I’m using a library for dates cljs-date and other stuff… so when I run in REPL:

(type (t/date))
=> #object[LocalDate]
How do I check for this type? I want to write a spec that checks if value is this cljs library’s date object and I don’t know what to put in instance? call.

Vishal Gautam17:03:16

(s/valid? inst? (t/date))


it’s not a js/date


there is not a built-in t/date? predicate?


I assume you're using tick. I didn't see a predicate but you can do:

(= (type my-thing) (type (t/date))


@zikajk I don't know of a ClojureScript one but AppAuthJS works pretty well - somewhat poorly documented but they have a complete working example and that was enough to figure it out. the API surface is pretty small - working directly against it would be straightforward - and it making prettier would be pretty trivial