hyperphor.tunamelt.core
Public API (ClojureScript): as on the JVM, but every function returns a Promise. The default store is the IndexedDB database “tunamelt”.
configure!
(configure! {:keys [store realm]})Set :store (a Store, or an IndexedDB database name) and/or :realm. Returns nil.
find
(find type)(find type opts)Promise of {:uri :obj :meta} of type, newest first. opts as on the JVM: :realm, :since/:until (inst or epoch ms), :limit, :attrs {k v}.
put
(put uri-or-type obj)(put uri-or-type obj opts)Upsert obj at a URI, or at a new id under bare type. opts {:mode :mutable|:append-only}; mode is fixed at creation. Promise of {:uri :obj :meta}.
referrers
(referrers uri)(referrers uri opts)Promise of entries (plus :attr) referring to uri, newest first. opts: :attr, :type.
search
(search query)(search query opts)Promise of entries matching query, best first, each plus :rank and :snippet. Every word must match as a prefix. :raw? is not supported on IndexedDB.
types
(types)(types {:keys [realm counts?]})Promise of a sorted seq of type names, or a sorted {type count} map with :counts?.