Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behavior of bound elements #15

Open
ghost opened this issue Jun 24, 2012 · 1 comment
Open

Inconsistent behavior of bound elements #15

ghost opened this issue Jun 24, 2012 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 24, 2012

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"]]

@Abdillah
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant