Files
nothoughts/src/cljs/emptyhead/lib/compose.cljs
2025-08-04 18:57:35 +02:00

16 lines
595 B
Clojure

(ns emptyhead.lib.compose
(:require [emptyhead.idea.memtag :as memtag]
[emptyhead.thought.extend :as extend]
[emptyhead.thought.crud :as thought]
[emptyhead.thought.define :as def]))
;; Append `(:data thought)` as execution child of `parent`.
(def/define! [:emptyhead :compose :append]
(fn [thought parent]
(let [op (:data thought)
stage [:emptyhead :compose :append (memtag/uid-of parent) (memtag/uid-of op)]
op (extend/register-extension! op stage)
parent (thought/add-ext-stage! parent stage)]
[parent nil])))