precept

Preception!
alex-dixon 2018-04-04T18:40:49.000776Z

Sure. Let me take a look

alex-dixon 2018-04-04T18:47:05.000435Z

This looks good, though be mindful with your first sub that you’ll get one name, and it will be the last one that matches

alex-dixon 2018-04-04T18:48:57.000387Z

the :segments sub looks like perfect use of the entities macro. There was an issue that never made it into a precept release with clara’s treatment of CLJS namespaces. If you’re not using a later version of Clara and somehow overriding Precept’s version there should be no issue

alex-dixon 2018-04-04T18:51:10.000300Z

I’m sorry this isn’t working. I’ll look as soon as I get a chance again, but not seeing anything. The usual startting and stopping everything, lein clean etc is first I’d suggest, to rule out any weird rule creation that may have been the result of hot-reloading and establish we’re working with a clean slate in general

alex-dixon 2018-04-04T18:52:42.000756Z

You should be able to place a let block above {:segments ?segments} in your subscription and print out what you’re getting there. Just make sure it’s a single let block wrapping a map

alex-dixon 2018-04-04T18:57:22.000211Z

The entities macro is really convenient, but it is just a helper. You can accomplish the same without a lot of extra overhead:

[?e :thing ]
[(<- ?the whole entity (entity ?e)]
=>
(insert! {(guid) :entities-list-item ?entity])

(defsub :my-ents
[?entities <- (acc/all :v) :from [_ :entities-list-item]
=>
{:my-ents ?entities}

amarjeet 2018-04-04T19:03:38.000064Z

cool cool, will give it another shot tomrw morning (my time) with things you suggested. And, I am using just [precept "0.4.0-alpha"] in my project. No additional Clara dependency. Working with the precept's project template only.

amarjeet 2018-04-04T19:06:30.000230Z

Also, Wanted to understand the difference between db-schema and client-schema. I made some understanding based on the docs, and thought that if I wanna make some API request, then db-schema can kick-in and when I am using query (or inserts) in session, then client-schema can kick-in. But, after some work, I realized that I was wrong. What exactly are the explicit use-cases for the two?

alex-dixon 2018-04-04T20:09:58.000251Z

@amarjeet That’s a great idea. It was a feature I wanted but never tried out much. There’s some function that allows you to extract facts that are covered by the db-schema. I’ll try to look into it more so I can provide a better answer and outline the functionality that’s possible right now