juxt / clip

Light structure and support for dependency injection
MIT License
228 stars 15 forks source link

cljs clip/stop error #38

Closed abritov closed 1 year ago

abritov commented 1 year ago
(def config {:executor juxt.clip.promesa/exec
               :components
               {:a {:start (list promesa.core/resolved 10)}}})

(def system (clip/start config))

(clip/stop config system)

Output: ; Execution error (Error) at (<cljs repl>:1). ; [object Promise] is not ISeqable

Expected to run without errors.

shadow-cljs.edn

{:source-paths
 ["src/dev"
  "src/main"
  "src/test"]

 :dependencies
 [[funcool/promesa "4.0.2"]
  [binaryage/oops "0.7.2"]
  [juxt/clip "0.28.0"]]

 :builds
 {:app
  {:main app.core/main
   :target :node-script
   :compiler-options {:infer-externs :auto}
   :output-to "dist/app.js"
   :devtools
   {:after-load app.core/start!
    :before-load-async app.core/stop!}}
  :test
  {:target :node-test
   :output-to "dist/tests.js"
   :autorun true}}}

"shadow-cljs": "2.25.2" Clojure CLI version 1.11.1.1323

SevereOverfl0w commented 1 year ago

This is because you haven't resolved your system. Try this instead:

(def config {:executor juxt.clip.promesa/exec
               :components
               {:a {:start (list promesa.core/resolved 10)}}})

(def system (clip/start config))

(-> system (.then #(clip/stop config %)))