Skip to content

Instantly share code, notes, and snippets.

@VirtueMe
Last active September 8, 2015 13:18
Show Gist options
  • Select an option

  • Save VirtueMe/15f62eb5ec84603ea888 to your computer and use it in GitHub Desktop.

Select an option

Save VirtueMe/15f62eb5ec84603ea888 to your computer and use it in GitHub Desktop.
Clean code, but I don't think someone would accept a PR based on this .-)
// I see this often done,
// It repeats code and it looks like something from a lisp dialect
// it doesnt look so bad, but I don't like it.
this.state = realOptions.withProps
? Base.calculateState(null, props)
: Base.calculateState(null, undefined);
// In my world this seems more straight to the case
this.state = Base.calculateState(null, realOptions.withProps ? props : undefined);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment