Skip to content

Commit

Permalink
feat: add system/states-map utility function
Browse files Browse the repository at this point in the history
  • Loading branch information
armed committed Mar 20, 2023
1 parent f87ba59 commit 5dca77a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/k16/gx/beta/system.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@
(when-let [gx-map (get @registry* system-name)]
(filter-nodes (gx/states gx-map) selector))))

(defn states-map
([system-name]
(states-map system-name nil))
([system-name selector]
(some->> (states system-name selector)
(reduce (fn [acc [k v]]
(update acc v conj k))
{}))))

(defn values
"Gets list of values of the graph as map.
Optionally accepts selector as set of nodes from the graph.
Expand Down

1 comment on commit 5dca77a

@vercel
Copy link

@vercel vercel bot commented on 5dca77a Mar 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

gx – ./

gx-kepler16.vercel.app
gx-git-master-kepler16.vercel.app
gx.kepler16.com

Please sign in to comment.