rum

Simple, decomplected, isomorphic HTML UI library for Clojure and ClojureScript | 0.12.8 https://github.com/tonsky/rum/blob/gh-pages/CHANGELOG.md#0128
sova-soars-the-sora 2021-06-10T20:05:47.006Z

I guess I'm doing something incorrectly here...

(rum/defc image-preload < rum/reactive []
  [:div
  	(map #([:img {:src %}]) (vals setting-map))])

sova-soars-the-sora 2021-06-10T20:06:07.006500Z

My issue is that on mobile the images for this javascript app do not load, so I thought I might preload them at the bottom of the page...

sova-soars-the-sora 2021-06-10T20:06:42.007Z

(def setting-map 
	{:cafe "img/cafe.jpg"
	 :livingroom "img/livingroom.png"
	 :museum "img/museum.jpg"
	 :store "img/store.jpg"
	 :park "img/park.jpg"})

sova-soars-the-sora 2021-06-10T20:07:21.007200Z

I get an "invalid arity: 0

sova-soars-the-sora 2021-06-10T20:10:27.007500Z

oh I can use (fn [n] but not #(%)

👍 1
Azzurite 2021-06-11T10:10:57.008400Z

yeah with #(x) you're trying to call x as a function, so in this case you're trying to call a vector as a function, which you can, calling a vector as a function gets you an element at a specific index, i.e. ([1 2 3] 0) will give you 1. But you're just calling the vector without any argument, i.e. incorrect arity.

Azzurite 2021-06-11T10:11:50.008600Z

with (fn [] x) you're returning x when the function is called. For both to be the same, you'd need to do (fn [] (x))

sova-soars-the-sora 2021-06-11T18:17:04.008800Z

interesting

sova-soars-the-sora 2021-06-10T20:10:30.007700Z

o.O

sova-soars-the-sora 2021-06-10T21:11:23.008200Z

Alright check it out: visual demonstration of japanese grammar https://japanesecomplete.com/magic-sentence made with rum ^_^

❤️ 1