Skip to content

Conversation

@MarlonPassos-git
Copy link

Description

As discussed in PR #172, the best approach might be to create a variant of the original function that retains error messages in production. This PR introduces a new version of the function. The original function remains unchanged; a copy was made to include this feature. This approach avoids any breaking changes, requiring only a minor release.

Inspired by the library's author, I named this new variant keep-messages. The final import looks like this:

import invariant from 'tiny-invariant/keep-messages';

invariant(condition, 'This message will be available in production');

Related

#172
#198
#176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant