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

Can assoc map or vector while remaining a bean #68

Closed
mfikes opened this issue Jul 5, 2019 · 0 comments · Fixed by #69
Closed

Can assoc map or vector while remaining a bean #68

mfikes opened this issue Jul 5, 2019 · 0 comments · Fixed by #69

Comments

@mfikes
Copy link
Owner

mfikes commented Jul 5, 2019

This shows how two maps that are {:a 1, :b {:x 2}} can turn into two different JavaScript representations. The problem is that assoc on a bean can assoc a non-primitive value without it snapshotting to a regular persistent data structure.

cljs.user=> (require '[cljs-bean.core :refer [->clj ->js]])
nil
cljs.user=> (->js {:a 1 :b {:x 2}})
#js {:a 1, :b #js {:x 2}}
cljs.user=> (assoc (->clj #js {:a 1}) :b {:x 2})
{:a 1, :b {:x 2}}
cljs.user=> (->js *1)
#js {:a 1, :b {:x 2}}
@mfikes mfikes changed the title Can assoc a non-primitive while remaining a bean Can assoc map or vector while remaining a bean Jul 5, 2019
@mfikes mfikes closed this as completed in #69 Jul 8, 2019
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

Successfully merging a pull request may close this issue.

1 participant