Skip to content

Instantly share code, notes, and snippets.

@gaspard
Created September 12, 2016 09:20
Show Gist options
  • Save gaspard/677926d22618431cc129b4ed2f32720a to your computer and use it in GitHub Desktop.
Save gaspard/677926d22618431cc129b4ed2f32720a to your computer and use it in GitHub Desktop.
// Original signal definition layout by Christian
[
dispatch(AUTHENTICATING),
authenticateUser, {
error: [
dispatch(AUTHENTICATED_ERROR)
],
success: [
dispatch(AUTHENTICATED_SUCCESS),
dispatch(ASSIGNMENTS_LOADING),
getAssignments, {
error: [
dispatch(ASSIGNMENTS_LOADED_ERROR)
],
success: [
dispatch(ASSIGNMENTS_LOADED_SUCCESS),
dispatch(MISSING_USERS_LOADING),
getMissingUsers, {
error: [
dispatch(MISSING_USERS_LOADED_ERROR)
],
success: [
dispatch(MISSING_USERS_LOADED_SUCCESS)
]
}
]
}
]
}
]
// Refactoring to use slightly different indenting rules
[ dispatch(AUTHENTICATING)
, authenticateUser
, { error:
[ dispatch(AUTHENTICATED_ERROR)
]
, success:
[ dispatch(AUTHENTICATED_SUCCESS)
, dispatch(ASSIGNMENTS_LOADING)
, getAssignments
, { error:
[ dispatch(ASSIGNMENTS_LOADED_ERROR)
]
, success:
[ dispatch(ASSIGNMENTS_LOADED_SUCCESS)
, dispatch(MISSING_USERS_LOADING)
, getMissingUsers
, { error:
[ dispatch(MISSING_USERS_LOADED_ERROR)
]
, success:
[ dispatch(MISSING_USERS_LOADED_SUCCESS)
]
}
]
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment