The Context API is how Datomic-driven tables and forms are implemented.
- It tracks Datomic metadata (schema, parsed query, result)
- "cursor" into resultset as we traverse and navigate
- Understands hyperlinks and fiddle datamodel
The public APIs you care about:
hypercrud.browser.context/eav– return the current eav triple which identifies where we are focused
hypercrud.browser.context/data– return the currently focused result subtree identified by eav
APIs you only care about in advanced custom renderers (e.g. with links):
hypercrud.browser.context/row-key– compute an identifier of a row in a result to use as an index. Handles :db.cardinality/many, FindRel vs FindColl, :db.unique/identity vs :db/ident vs :db/id, etc.
hypercrud.browser.context/row– Given a rowkey, lookup the row
This API is alpha and will be migrated to a
hyperfiddlenamespace when mature.