Wrap-Up
The design and implementation of Strickland ends up being fractal, with extensibility and composability available at every turn. Because validator functions are so simple, Strickland is a great framework on which you can build the validator libraries you need for your applications. And since Strickland is pure JavaScript and not coupled to any other libraries or concepts, it can be used in any JavaScript application.
Using Strickland's built-in validators, and its extensibility and composability, you can build your application's validation library and provide rich validation experiences for your users.
Core Concepts
Validators are implementations of your validation rules
Validation is the act of executing a validator against a value
Validation Results are the output of validation for the given validator and value
Extensibility Concepts
Validator Factories are functions that take parameters and return validator functions
Validation Context is provided to validators allowing application state to influence validation logic
Validation Result Props allow applications to produce rich user experiences
Composition Concepts
Arrays of Validators can be used to validate a value against multiple validators
****Validating Array Elements is easily done using the arrayElements validator
Validating Objects is accomplished by building objects that define how the props should be validated
Composition Conventions enable terse and natural definitions of complex compositions
Async Validation
Validators Can Use Promises to provide async validation capabilities
Composition Supports Promises within arrays of validators, array elements, and object validation
Two-Stage Sync/Async Validation is conducted using the
validateAsync
function
Form Validation
Form Validation supports interactive field-level or form-level validation
Feedback
If you're interested in Strickland and have any feedback, please reach out in one of the following ways:
Submit issues on GitHub
Tweet to @JeffHandley
Last updated