Skip to content

Instantly share code, notes, and snippets.

@ladas-larry
Created August 12, 2017 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ladas-larry/9c272417dc825627085977214cd2027f to your computer and use it in GitHub Desktop.
Save ladas-larry/9c272417dc825627085977214cd2027f to your computer and use it in GitHub Desktop.
//Encapsulate conditionals
function shouldShowSpinner(fsm, listNode) {
return fsm.state === 'fetching' && isEmpty(listNode);
}
if (shouldShowSpinner(fsmInstance, listNodeInstance)) {
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment