A reagent reactive wrapper around Datascript's transactor
It provides both reactive queries and pull patterns.
Custom transactions are supported through middlewares. A middleware is a function with the signature (middleware) => (db transaction) => transaction
Therefore a middleware is a high order function which returns a function that will receive the current state and the current transaction and returns a transaction. The transaction resulting from the chain will be used instead of the original one
A reagent reactive wrapper around Datascript's transactor It provides both reactive queries and pull patterns. Custom transactions are supported through middlewares. A middleware is a function with the signature (middleware) => (db transaction) => transaction Therefore a middleware is a high order function which returns a function that will receive the current state and the current transaction and returns a transaction. The transaction resulting from the chain will be used instead of the original one
(listen! conn)
(listen! conn middlewares)
registers a listener for the connection transactions. Returns the conn object itself with the added listener and state holder
Subsequent usages of conn in q! and pull! will return reactive atoms that will update their value whenever the Datascript value changes
middlewares is a sequence of middlewares like [f g h ...] which will be applied in order to each transaction
registers a listener for the connection transactions. Returns the conn object itself with the added listener and state holder Subsequent usages of conn in q! and pull! will return reactive atoms that will update their value whenever the Datascript value changes middlewares is a sequence of middlewares like [f g h ...] which will be applied in order to each transaction
(pull! conn selector eid)
same as datascript/pull but returns a ratom which will be updated every time that the value of conn changes
same as datascript/pull but returns a ratom which will be updated every time that the value of conn changes
(q! query conn & inputs)
Returns a reagent/atom with the result of the query. The value of the ratom will be automatically updated whenever a change is detected
Returns a reagent/atom with the result of the query. The value of the ratom will be automatically updated whenever a change is detected
(transact! conn tx-data)
(transact! conn tx-data tx-meta)
same as datascript/transact! but uses the transaction from the middleware chain instead of tx-data
same as datascript/transact! but uses the transaction from the middleware chain instead of tx-data
(unlisten! conn)
unregisters the transaction listener previously attached with listen!
unregisters the transaction listener previously attached with listen!
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close