Skip to content

Instantly share code, notes, and snippets.

@zspecza
Last active November 16, 2016 19:45
Show Gist options
  • Save zspecza/1819069dfcb16c955f95214846b7c138 to your computer and use it in GitHub Desktop.
Save zspecza/1819069dfcb16c955f95214846b7c138 to your computer and use it in GitHub Desktop.
const validateTransformation = sequentialCallback(
transformSomething,
validateTransformed,
(validated, callback) => callback(null, validated, 'data is valid:')
)
validateTransformation({ foo: 'bar' }, (error, validated, label) => {
if (error) {
console.error(new Error(error))
} else {
console.log(label, validated)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment