nosco / hx

A simple, easy to use library for React development in ClojureScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hx.hooks/useMemo deps as CLJS collection?

aiba opened this issue · comments

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?

I would accept a PR for this.