mirror of
https://github.com/logseq/logseq.git
synced 2026-04-27 15:45:00 +00:00
chore: add debug helper
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
[frontend.db.conn :as conn]
|
||||
[frontend.modules.datascript-report.core :as db-report]
|
||||
[frontend.db :as db]
|
||||
[frontend.state :as state]))
|
||||
[frontend.state :as state]
|
||||
[frontend.debug :as debug]))
|
||||
|
||||
;;;; APIs
|
||||
|
||||
@@ -33,6 +34,22 @@
|
||||
(let [undo-stack (get-undo-stack)]
|
||||
(swap! undo-stack conj txs)))
|
||||
|
||||
(comment
|
||||
(defn get-content-from-entity
|
||||
"For test."
|
||||
[entity]
|
||||
(filterv (fn [[_ a & y]]
|
||||
(= :block/content a))
|
||||
(:txs entity)))
|
||||
|
||||
(defn get-content-from-stack
|
||||
"For test."
|
||||
[stack]
|
||||
(mapv #(get-content-from-entity %) stack))
|
||||
|
||||
(debug/pprint "pop entity" (get-content-from-entity removed-e))
|
||||
(debug/pprint "undo-stack" (get-content-from-stack @undo-stack)))
|
||||
|
||||
(defn pop-undo
|
||||
[]
|
||||
(let [undo-stack (get-undo-stack)]
|
||||
@@ -102,6 +119,7 @@
|
||||
(defn listen-outliner-operation
|
||||
[{:keys [tx-data tx-meta] :as tx-report}]
|
||||
(when-not (empty? tx-data)
|
||||
(debug/pprint "tx-data" tx-data)
|
||||
(reset-redo)
|
||||
(let [updated-blocks (db-report/get-blocks tx-report)
|
||||
entity {:blocks updated-blocks :txs tx-data
|
||||
|
||||
Reference in New Issue
Block a user