function | since v0.0-927 | Edit |
(run-in-order {:keys [expecting fns]})
(defn run-in-order [{:keys [expecting fns]}]
(loop [order expecting fns fns]
(if-let [f (get fns order)]
(do
(f)
(recur (inc order) (dissoc fns order)))
{:expecting order :fns fns})))