CoNarrative / precept

A declarative programming framework
MIT License
657 stars 33 forks source link

Filter persistent from non-persistent facts #64

Closed alex-dixon closed 7 years ago

alex-dixon commented 7 years ago

Should be relatively easy to implement™️.

Schemas are stored in state/schemas. API function persistent-facts or somesuch would:

  1. Get all idents from the persistent schema (believe there is a function in schema ns for this.
  2. Select those keys from the view model (we still store facts at the top level regardless of whether they have a subscription)
  3. Reduce into vector with fn to check if attr is one-to-many. If so, map values to [e a v] and concat with accumulated. Otherwise conj the current with accumulated
alex-dixon commented 7 years ago

Added to persistent-facts to schema ns in 34911e68f0d121ba7600435889ad73e173a08e27.

TODO. Add docstring

alex-dixon commented 7 years ago

Note persistent-facts does not analyze or include any data from subscriptions. Closing.