Why aren't NodeList / HtmlCollection seqable?

前端 未结 2 993
一个人的身影
一个人的身影 2021-02-02 13:54

As a newcomer to Clojurescript it appears to me that every Clojurescript project will have some snippet of code like this:

(extend-type js/NodeList
  ISeqable
           


        
2条回答
  •  终归单人心
    2021-02-02 13:55

    If you are looking for a way to create a sequence from a NodeList there is array-seq function.

    (array-seq (js/document.querySelectorAll "div"))
    

提交回复
热议问题