Last active
September 22, 2017 16:12
-
-
Save kojinkai/8c3584f7a37a885cd9bc8232f86a20eb to your computer and use it in GitHub Desktop.
A higher order validation pipeline function for combining validation rules into a pipeline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createValidationPipeLine = filters | |
=> (values, value, otherField) | |
=> filters.reduce((currentValue, filter) | |
=> filter(values, value, otherField), value); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment