clojurescript

Creating animations with Clojurescript Om

本小妞迷上赌 提交于 2019-11-28 19:44:29
I've been looking around for how to create animations in Om, I've tried creating a RaphaelJs component with moderate success. I get the animation I want, but for some reason Om renders multiple instances of the SVG element. Looking at the animation example in the Om github folder uses setInterval to change the values you want to animate, which is less than ideal. I'm aware of the CSSTransitionGroup addon, but it looks like you can only flip between preset animations defined in the CSS, you can't decide to do something like rendering a path and having a shape following it with randomised

Can't seem to require >!! or <!! in Clojurescript?

落爺英雄遲暮 提交于 2019-11-28 09:09:51
I must be missing something very obvious here but I'm trying to setup a very basic program to put an item onto a channel then block until I can take it off again. The entire program is below: (ns shopping-2.core (:require [cljs.core.async :as async :refer [>!! <!! put! chan <! close! <!!]])) (let [c (chan)] (>!! c "hello") (.write js/document (<!! c)) (close! c)) The JavaScript error I'm getting is: Uncaught TypeError: Cannot call method 'call' of undefined I had that error before when I forgot to :refer chan in (if I just open the channel, then close it again the program runs fine) However

How can I get Clojure :pre & :post to report their failing value?

南笙酒味 提交于 2019-11-27 20:05:34
(defn string-to-string [s1] {:pre [(string? s1)] :post [(string? %)]} s1) I like :pre and :post conditions, they allow me to figure out when I have put "square pegs in round holes" more quickly. Perhaps it is wrong, but I like using them as a sort of poor mans type checker. This isn't philosophy though, this is a simple question. It seems in the above code that I should easily be able to determine that s1 is a function argument in the :pre condition. Similarily, % in the :post condition is always the function return value. What I would like is to print the value of s1 or % when either of these

Creating animations with Clojurescript Om

匆匆过客 提交于 2019-11-27 12:31:02
问题 I've been looking around for how to create animations in Om, I've tried creating a RaphaelJs component with moderate success. I get the animation I want, but for some reason Om renders multiple instances of the SVG element. Looking at the animation example in the Om github folder uses setInterval to change the values you want to animate, which is less than ideal. I'm aware of the CSSTransitionGroup addon, but it looks like you can only flip between preset animations defined in the CSS, you

How can I install Leiningen packages behind a firewall?

蓝咒 提交于 2019-11-27 07:28:27
问题 I use a local library to do some development, but the firewall prevents alot of internet sites. Is there a way to download artifacts manually? My project.clj is: https://github.com/zubairq/coils/blob/master/project.clj? Update From the comments given I am understanding that the steps to take are: 1) Install Maven 2) Find out which jars are in my project (How can I do this based on my project.clj?) 回答1: Dependency Tree In order to figure out which jars your project needs you can do: $ lein

Reagent React Clojurescript Warning: Every element in a seq should have a unique :key

旧街凉风 提交于 2019-11-27 03:20:58
问题 I have copied a two year old gist from here. It is now working with Figwheel and uses a more recent version of Reagent/React. I am looking for a generic way of isolating this warning message that comes to the Javascript console: Warning: Every element in a seq should have a unique :key . The idea is to put a :key with a generated unique value into all the components. Then the messages ought to disappear and I'll be in a position to see which components needed the unique :key . My problem is