Fork me on GitHub
#clojurescript
<
2016-12-17
>
juhoteperi08:12:00

@cdimara Cljs 1.7.228 is the first version of Cljs with which boot-cljs works properly

borkdude12:12:39

goog.dom contains getDocumentScroll, but how do you set the scroll using this library?

borkdude12:12:20

by setting document.body.scrollTop ?

martinklepsch12:12:22

@borkdude I think that's correct. Also document.scrollTop is a thing. There are some SO answers that show a cross browser compatible one liner

martinklepsch12:12:02

@borkdude probably they decided it's supported well enough and didn't include it

borkdude12:12:26

I’m making a bookmarklet which restores the scroll location of a page. I have this code in it:

(do (set! (.. js/document -body -scrollTop)
          (.getItem js/localStorage "scroll-y"))
    nil)
But somehow it displays the scrollTop location as the new content of the page...

borkdude12:12:55

(continuing in #boot)

ghosttoaster14:12:39

@juhoteperi so later versions of cljs just work? Don't you have to tell boot-cljs that you're using a newer version of cljs?

martinklepsch14:12:44

@cdimara if you add a dependency for a newer version of ClojureScript it will be used

ghosttoaster14:12:53

@martinklepsch Ah. Where would you do this? Because clojurescript 1.7.2 is hard coded right into the boot-cljs task source code.

martinklepsch14:12:32

@cdimara you just specify it in your :dependencies

martinklepsch14:12:49

@cdimara what's in the task is the fallback if there's no dependency on Clojurescript at all

martinklepsch14:12:54

You can look at the compiled file (the one that you load in your browser) and it will say which version of ClojureScript was used to compile it

martinklepsch14:12:27

you're welcome 🙂

jupl18:12:45

Is there anything available in CLJS land for fixed time timeout/intervals? There’s stuff like setTimeout, setInterval, and cljs.core.async/timeout but I’m looking for more like launching something at 8PM each day or something similar. I found Later.js in JS land but if I go that route I need to spend some time writing externs.

henriklundahl18:12:23

@jupl I haven't seen anything. Externs handling seems to get easier with some recent changes on ClojureScript master, though. See https://gist.github.com/swannodette/4fc9ccc13f62c66456daf19c47692799.

henriklundahl18:12:01

Anyone who knows whether Transit over JSON is susceptible to JSON Hijacking?

sova-soars-the-sora19:12:08

@martinklepsch thanks a lot for your "Om/Next Reading List"

raaon19:12:42

@om-nexters i have a mutation that answers a remote that fires off the mutation to the backend. what's the correct (or idiomatic) way to get a (:remote) read to happen subsequent to this?

raaon19:12:43

i'm not optimistically writing to local state. i'd like a subsequent remote read to happen to get the backend server's new value(s)

chrisoakman19:12:51

@jupl Seems you could put together a solution like this using js/setInterval and an atom pretty easily. Just fire a function every 1 second and check "is it after 8pm and have we not run the cron job today?"

kishanov20:12:09

Is there a way to programmatically access function’s source, defined in the same namespace? (cljs.repl/source my-fn) prints "Source not found"

mfikes21:12:33

@kishanov That should work, unless my-fn was defined at the REPL (i.e., there is no on-disk source.)