Skip to content

Instantly share code, notes, and snippets.

View bjenkins24's full-sized avatar

Brian Jenkins bjenkins24

  • Murrieta, CA
  • 13:54 (UTC -08:00)
View GitHub Profile
// Destructuring cleans it up a bit
const { postCatalogues, updateCatalogues } = this.props;
const { catalogueName, activeStatusValidation } = formValidation;
// Bail early
if (catalogueName || activeStatusValidation) return;
// Model the data to avoid a switch - this makes more sense to me - seems more clear - you could even take this out of
// this method completely and include it as a property on the React component, as you may end up with more than add and edit,
// and perhaps it will be needed elsewhere?