Using Flapjax in ClojureScript

50 views
Skip to first unread message

Micha Niskin

unread,
Dec 2, 2012, 12:56:43 PM12/2/12
to fla...@googlegroups.com
Hi everyone!

First, I've been having a great time using Flapjax in ClojureScript. It's a testament to the care you guys took that it can be used nearly without modification. However, there is a slight issue when tunneling ClojureScript event data: Flapjax has no way to determine correct identity of ClojureScript objects. For example, in ClojureScript you can do: (= [1 2 3] [1 2 3]) => true, (= [1 2 3] [1 3]) => false. Flapjax, of course, does not use the ClojureScript equality test, so it must compare two PersistentVector instances, but instance equality is not what we want (i.e. the two PersistentVector instances may be stored in different memory locations, but they are, in fact, identical due to ClojureScript's immutable PersistentVector implementation).

I implemented a filterRepeatsE function in clojurescript to replace the Flapjax one (using cljs equality test), but modification of the pulse propagation machinery is not as simple as that. Behaviors that contain cljs values send spurious change pulses. What do you guys think of the possibility of abstracting equality testing in Flapjax? Flapjax is already incredibly well designed in that event data and updater functions are opaque---equality testing seems to be the only place where this abstraction leaks.

Thanks!
Reply all
Reply to author
Forward
0 new messages