I would like to have a more meaningful name for the function than invariant. Something like throwOnFalsy is for me easier to understand.
While working with developers that don’t know what tiny-invariant is, I realized that is not easy understand at first sight what the invariant function does. To improve this, it would be nice to rename the function with something more descriptive. I would still keep the original function to avoid breaking changes but also allow to import the new function with the descriptive name.
What do you think? Is throwOnFalsy good for you or maybe you have a better name?
If you think it is a good idea, I would submit a PR for that.
I would like to have a more meaningful name for the function than
invariant. Something likethrowOnFalsyis for me easier to understand.While working with developers that don’t know what
tiny-invariantis, I realized that is not easy understand at first sight what theinvariantfunction does. To improve this, it would be nice to rename the function with something more descriptive. I would still keep the original function to avoid breaking changes but also allow to import the new function with the descriptive name.What do you think? Is
throwOnFalsygood for you or maybe you have a better name?If you think it is a good idea, I would submit a PR for that.