Live data from Hacker News

The Rise of Immer in React

netlify.com

1–9 of 9 posts

Re: The Rise of Immer in React

#3
post #2

Main issue with immer is a lack of custom types support (like Record in immutable.js)

Why would you be using Immer and Immutable.js together? They seem pretty much mutually exclusive. Immer works on plain JS objects and arrays, while Immutable.js has its own set of APIs for objects.

Re: The Rise of Immer in React

#4
post #3
post #2

Main issue with immer is a lack of custom types support (like Record in immutable.js)

Why would you be using Immer and Immutable.js together? They seem pretty much mutually exclusive. Immer works on plain JS objects and arrays, while Immutable.js has its own set of APIs for objects.

I do not use Immer and Immutable together. I use Immutable mostly as I want to have custom types. I think I'll use Immer most of the time after implementing api like [1]

[1] https://github.com/mweststrate/immer/issues/202

Re: The Rise of Immer in React

#7

It's great you've noticed immutability in a singled threaded environment is a nonsense. Why to go further with own implementation then?

Pure functions are great, regardless of threading / concurrency problems.

I know you don't _need_ immutability enforced at the object level to write pure functions, but I could understand the argument in its favor.

Re: The Rise of Immer in React

#9
post #8

It's great you've noticed immutability in a singled threaded environment is a nonsense. Why to go further with own implementation then?

Immutability is highly useful in a browser environment for efficient rendering of UI.

So in order to mutate DOM and present mutable state, you think you need to introduce immutability in the middle? Someone mislead you.