In a reused form component for both the record creation and the record modification, is it acceptable to use ternary operators instead of if/else like this?
It's a clear-cut case. With code-formatting of new-line and indent, it's quite readable. And in the foreseeable future, for each condition of the formAction, the business logic is unlikely to be changed.
In a reused form component for both the record creation and the record modification, is it acceptable to use ternary operators instead of if/else like this?
It's a clear-cut case. With code-formatting of new-line and indent, it's quite readable. And in the foreseeable future, for each condition of the
formAction
, the business logic is unlikely to be changed.