paf31 / purescript-jquery

Type declarations for jQuery
MIT License
30 stars 28 forks source link

Add toArray #28

Closed foollbar closed 7 years ago

foollbar commented 8 years ago

I'm not sure whether it is proper type declaration for toArray. but this may facilitates following.

do
  b <- body
  li <- toArray =<< find "li" bi
  texts <- traverse getText li
  traverse log texts
paf31 commented 8 years ago

Does toArray return a live array? i.e. if the DOM gets updated after calling toArray, will the result change, or is it safe to assume this returns an immutable snapshot?

paf31 commented 7 years ago

I'll add this in the next release, creating a copy of the array to be safe. Thanks!