4 ms·
I'm looking forward to deleting all the annoying `.toJS()` conversions everywhere I've used an immutable-js collection rather than a js array. (PR: https://gith
by dmnd 12y ago
I'm looking forward to deleting all the annoying `.toJS()` conversions everywhere I've used an immutable-js collection rather than a js array. (PR: https://github.com/facebook/react/pull/2376 https://github.com/facebook/react/pull/2376)
- donw 12y agoOh god, this. Using Immutable (via Immstruct) has been glorious, but this has been a minor annoyance that I'll be glad to be rid of. Now all I need to do is sort out some issues with dispatch and I'm good to go...
- amccloud 12y agoDoes Immstruct use Immutable's cursors? If so, you'll still need to use .toArray() when dealing with a cursor to an array. React doesn't like what you get after mapping over an IndexedCursor.
- donw 12y agoIt does, but you can just .deref()
- amccloud 12y agoI'm usually looping over cursors I want to pass as a prop to a child component. Deref-ing there would sorta defeat the purpose of cursors.
- donw 12y agoAh, fair enough. I usually deref before handing the data off to the rendering chain, on the basis that future updates will just kick off another render loop.