zertosh / invariant

invariant
MIT License
1.22k stars 70 forks source link

disable in production mode #15

Closed xjamundx closed 8 years ago

xjamundx commented 8 years ago

It might be great to disable this when NODE_ENV is production.

obviously we can use something like strip-loader to accomplish that, but I see invariant is already having separate behavior for prod-mod, and maybe just not throwing would be nice.

thoughts?

zertosh commented 8 years ago

Throwing is the desired behavior though.

cooperka commented 7 years ago

@xjamundx invariants should never ever be false. If you want something that's disabled in production you could try warning instead (also a mirror of Facebook's warning).