Fork me on GitHub
#clojurescript
<
2023-06-29
>
scknkkrer06:06:24

I wanted to use Enfocus in my product. But it appears to be dead. I wanna bring it alive. But, first, wanna know if anyone else have done it before me? Context: dead, because of the breaking changes in the dependencies.

Lidor Cohen13:06:34

Hello, I picking a bit inside core.cljs and I found this in most of the main types:

Object
  (toString [coll]
    (pr-str* coll))
  (equiv [this other]
    (-equiv this other))

  ;; EXPERIMENTAL: subject to change
  (keys [coll]
    (es6-iterator (keys coll)))
  (entries [coll]
    (es6-entries-iterator (seq coll)))
  (values [coll]
    (es6-iterator (vals coll)))
  (has [coll k]
    (contains? coll k))
  (get [coll k not-found]
    (-lookup coll k not-found))
  (forEach [coll f]
    (doseq [[k v] coll]
      (f v k)))
does anyone knows what is the main usage of those methods?

Roman Liutikov13:06:03

JS interop, those are standard methods on JS iterables

Lidor Cohen13:06:46

are they important for clj->js by any chance?

hifumi12321:06:35

es6-iterator-seq is handy for some built-in JS stuff that returns iterators

hifumi12321:06:06

in one of my cases, it was useful for getting a seq of fonts that the browser has available

🙏 2