- When no schema supplied, `make-ancestors-fn` is called with no arguments, which will entail a one to one relationships for all facts.
**Add implementation-level rules ns**
- Include rules defined in `impl.rules` in every session definition. These are intended to be rules we previously used in every session and that are essential to the implementation, such as action cleanup. The ns currently includes this rule as well as cleanup of any facts with eid of `:transient`, which may replace the "action" fact type in the near future.
**Add facts from the view**
- Redefined `then` as `insert`:
```clj
(defn then
"Inserts facts into current session"
[facts]
(dispatch! (fn [session] (util/insert session facts))))
This addition is intended to remove boilerplate associated with the previous action implementation and stems from the realization that in the vast majority of cases we were inserting facts without manipulating the data received from the action message.
Justification for this includes:
Facts about the change itself (i.e. "the mouse moved") can still be inserted into the session when that information is required.
All facts can be intercepted by rules in the :action group before they reach downstream rules regardless of whether our implementation associates particular facts with an action concept.
We have considered the arguments in favor of the action paradigm popularized by Redux, reframe, and others. In practice it has not aided in understanding or tracking state changes as claimed. In theory we have come to view it as an instance of accidental complexity.
When there is something for which we only care to know the current value (if one exists), we insert a transient fact:
Any fact with the eid :transient will last one rule firing.
Clean up todomvc example
Brought up to date with changes above
Biggest room for improvement still with subscription rules, bearing in mind we would prefer not to have subscriptions
Added note and did some investigation on an entity macro we could use to replace (acc/all) :from [?e :all]. Would prefer to be able to have IDE recognize it and also not have to detect in our existing macros, but have yet to figure out how to expand the forms outside of a list
Minimize def-tuple-session boilerplate
(cr/defsession app-session 'precept.todomvc.rules :fact-type-fn :a :ancestors-fn ancestors-fn :activation-group-fn activation-group-fn :activation-group-sort-fn activation-group-sort-fn)
:action
group before they reach downstream rules regardless of whether our implementation associates particular facts with an action concept.When there is something for which we only care to know the current value (if one exists), we insert a transient fact:
Any fact with the eid
:transient
will last one rule firing.Clean up todomvc example
entity
macro we could use to replace(acc/all) :from [?e :all]
. Would prefer to be able to have IDE recognize it and also not have to detect in our existing macros, but have yet to figure out how to expand the forms outside of a list