Why would you use Immutable package?
Yordis Prieto
11

Mostly out of force of habit :)

Just keeps me honest about keeping state immutable. I actually haven’t needed to use it anywhere else in the tutorial yet, since there’s very little Redux takes care of in the app flow .

The auth store doesn’t really need to be there at all if we wanted to persist apollo store state, it’s just simpler to explain with a separate auth store because other issues need to be dealt with if you persist apollo… although once you solve those (and they’re pretty minor), you’ve successfully added offline mode :)

In a more complete application, I’d be tempted to use Redux for client state that doesn’t get pushed to the server ~ e.g. failed message attempts that need retrying/cancelling. Those sort of features can start to add up, so I find myself trying to have the architecture ready to deal with them, like a good immutable package.

Let me know your thoughts!

Like what you read? Give Simon Tucker a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.