crate icon indicating copy to clipboard operation
crate copied to clipboard

Inconsistent behavior of bound elements

Open ghost opened this issue 12 years ago • 1 comments

Steps to reproduce:

Start a browser-repl via cljsbuild (tried with Firefox and Chromium), and evaluate the following expressions in order of appearance:

(ns mynamespace (:use [jayq.core :only [$ append css inner]]) (:require [crate.core :as cr] [crate.binding :as cb]) (:use-macros [crate.def-macros :only [defpartial]]))

(def zomg (atom "hey"))

(defpartial t [a] [:p a])

(append ($ :body) (cr/html [:div (cb/bound zomg t)]))

(swap! zomg str " blah") (swap! zomg str " woo") (swap! zomg str " cool")

Result:

  • After evaluating the append expression, "hey" appears.
  • After evaluation any of the swap expressions, "[object HTMLParagraphElement]" appears in place of "hey"
  • re-evaluation of the append-expression shows the swapped atom after the "[object HTMLParagraphElement]"
  • re-swapping appends another "[object HTMLParagraphElement]", replacing the string
  • ...repeat

Using lein-cljsbuild 0.2.1 and

:dependencies [[org.clojure/clojure "1.4.0"] [crate "0.2.0-alpha4"] [jayq "0.1.0-alpha4"]]

ghost avatar Jun 24 '12 19:06 ghost

Some say, crate create Om compatible node abstraction. Well, I'm a beginner, I just quoting someone..

Abdillah avatar Jun 20 '15 13:06 Abdillah