Сообщения

Сообщения за февраль, 2017

Bug with Figwheel Client Version 0.5.8 is not equal to Figwheel Sidecar Version 0.5.9.

Figwheel Client Version 0.5.8 is not equal to Figwheel Sidecar Version 0.5.9. Just shift-reload your page in Google Chrome and that's it!

ClojureScript lifehacks

After ClojureScript Hackaton I've discovered several interesting tips. 1. Bug with loosing focus on input is due to nil value for string. In case you supply "" instead of nil bug dissapears. 2. Sometimes with RUM when you use for to loop through react components you should use with-keys 3. Nice desctructure for RUM when use local atoms can be done without let, right in parameters! Pushy and Bide are right choice for routing!

Dependency hell

Изображение
You can't imaging   how this shit depicts dependency hell , which was brilliantly discussed by Rich Hickey in his great talk Speculation.

New atom plugin for Clojure editing

Изображение
While Emacs is for brave and true, Atom is for the rest. But it's really interesting!

Using bower with clojurescript

Easy peasy.    :plugins [[lein-cljsbuild "1.1.4"]              [lein-bower "0.5.1"]] Connect bower plugin for lein and  do like following  lein bower install gentelella all resources will be fetched into resources/public folder of your project.

Tricks for namespaced and weird keywords

# :person { :first "Han" :last "Solo" :ship #:ship{ :name "Millenium Falcon" :model "YT-1300f light freighter" }} is read as: { :person/first "Han" :person/last "Solo" :person/ship { :ship/name "Millenium Falcon" :ship/model "YT-1300f light freighter" }} Also you can use this syntax (keyword :counters :fb) -> :counters/fb And to use spatial characters like :last_insert_rowid() from return value of Korma insert sql statement, I've found that way (keyword "last_insert_rowid()") -> :last_insert_rowid()

My Datascript tips and tricks

Sometimes you're using something like root structure with entity-id 0, that's convenient to do some routing and stuff like that I used to query this attrs like this (let [edit? (first (d/q '[:find [?v] :where [0 :person/edit ?v]] @conn))]]   edit?) But it's much better to use is like this via entity (let [edit? (:person/edit (d/entity @conn 0))]  edit?)