Skip to content

Commit

Permalink
minor: Allow passing fn to :operations dev component
Browse files Browse the repository at this point in the history
  • Loading branch information
julienvincent committed Feb 24, 2024
1 parent 54b0db8 commit 71262ff
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions packages/mallard/src/k16/mallard/dev.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
(:require
[k16.mallard.api :as api]
[k16.mallard.datastore :as datastore.api]
[k16.mallard.loaders.fs :as loaders.fs]
[k16.mallard.executor :as executor]))

(set! *warn-on-reflection* true)
Expand All @@ -17,17 +16,17 @@

[:or
[:map
[:operations executor/?Operations]]

[:map
[:load-dir :string]]]])
[:operations
[:or executor/?Operations
[:=> [:cat] executor/?Operations]]]]]])

(def run!
{:gx/start
{:gx/processor (fn [{:keys [props]}]
(let [{:keys [store context operations load-dir]} props]
(let [{:keys [store context operations]} props]
(api/run-up! {:store store
:context context
:operations (or operations
(loaders.fs/load! load-dir))})))
:operations (if (fn? operations)
(operations)
operations)})))
:gx/props-schema ?Props}})

0 comments on commit 71262ff

Please sign in to comment.