kliph / sunrise

Procedurally generates sunrises and sunsets
MIT License
0 stars 0 forks source link

pass maps instead of positional arguments #1

Closed kliph closed 6 years ago

ryanhinkel commented 6 years ago

I'm not sure I understand this issue.

kliph commented 6 years ago

For example, the mountain-path function accepts 5 arguments, https://github.com/kliph/sunrise/blob/master/src/sunrise/component.cljs#L23 . These arguments are just props, so it would be better if we accepted a single map, something like

(defn mountain-path [{:keys [n width height base nth-mountain] :as props}]
  ...

There are several places in the codebase where we're passing props like this.