Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hi 👋 Just wanted to thank you for building this lib. I'm thinking on using it internally for the next version of @msw/data to produce next records through drafts. Is there anything I should be aware of?

You must be logged in to vote

Replies: 1 comment · 2 replies

Comment options

Hey @kettanaito! Thanks so much for the kind words. I'm thrilled to hear that you're considering using it for @mswjs/data . That's a fantastic use case!

In most cases, Mutative works out of the box. Here are two recommendations:

  1. In a production environment, you should ensure enableAutoFreeze is set to false for optimal performance.
  2. If you want safer immutable updates, you can enable strict mode in the development environment and disable it in production.

Please don't hesitate to reach out if you have any other questions. I'd be happy to help. Good luck! :)

You must be logged in to vote
2 replies
@kettanaito
Comment options

Got it! Since I'm building a library, I should either treat as single environment as "production". What would be the good defaults for either environment? strict: true?

@unadlib
Comment options

For Mutative, the default values for strict and enableAutoFreeze are false, regardless of whether the environment is production or not.

Therefore, you could consider the default value in production to be false, unless it has been explicitly set by the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.