This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-05
Channels
- # admin-announcements (1)
- # beginners (17)
- # boot (5)
- # cljs-dev (50)
- # cljsrn (20)
- # clojars (8)
- # clojure (108)
- # clojure-belgium (1)
- # clojure-brasil (1)
- # clojure-greece (6)
- # clojure-japan (1)
- # clojure-russia (12)
- # clojure-spec (77)
- # clojurescript (19)
- # core-async (2)
- # cursive (4)
- # datomic (12)
- # dirac (6)
- # funcool (3)
- # hoplon (39)
- # lein-figwheel (14)
- # om (12)
- # onyx (3)
- # other-languages (1)
- # protorepl (14)
- # pure-frame (2)
- # re-frame (39)
- # reagent (1)
- # spirituality-ethics (3)
- # yada (7)
anyone using om.next with datascript? aside obvious benefits, what pitfalls should be avoided?
Having a simple problem I can’t seem to solve. Building a demo app of a shopping carts. Products and a cart. When you click “add to cart” from a product in the listing the item appears in a cart. I have all this working except when I push an item into cart_items I’m not sure how I’m suppose to do this — I need to keep track of count since you can say purchase more than one of same product. So my initial idea was: {:products [{id: 1 name: “Foo”}] :cart {1: {count: 3 product: [:product/by-id 1]}}}
so I’ve made my :cart
db-style (a map whose keys are the product ids) so I can easily update the count. Is this bad? Should I consider a different way, most importantly, I need to get that product info when I’m rendering a CartItem
and I don’t know how to do it
@tomjack: yeah, I can’t seem to figure out how to get the data for the product into the cart item doing it the way I am right now
so I might as well try that
it seems maybe doable with the map if you write some custom read logic, but I'm not sure what to do about ui->props
@tomjack so, I’m trying the other route. https://gist.github.com/whistlerbrk/c003125f605bbfae6dadb6ec3ca630a2 you’ll see in my init data I’ve primed the cart, but I still can’t get that product ref to work, I’m assuming the issue is in my defui for CartItem