nosco / hx

A simple, easy to use library for React development in ClojureScript.
MIT License
249 stars 16 forks source link

hx.hooks/useMemo deps as CLJS collection? #67

Closed aiba closed 4 years ago

aiba commented 4 years ago

docs for hx.hooks/useMemo say that deps can be a cljs collection, but I don't think this is true according to the source.

Shall we update useMemo? While we're at it, we can make deps optional for convenience.

(defn useMemo [f & [deps]]
  (react/useMemo f (to-array (or deps []))))

Would you accept this PR?

lilactown commented 4 years ago

I would accept a PR for this.