Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/allow production message #200

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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