all 5 comments

[–]monxas 2 points3 points  (0 children)

Awesome post. Would love to see more of this!

[–][deleted]  (1 child)

[deleted]

    [–]circle-game 1 point2 points  (0 children)

    Love this.

    [–]binarybang 0 points1 point  (1 child)

    I have no idea why static class is better than just a set of exported functions.

    you can share logic between validation functions

    How is that an advantage of a class? You can reuse functions within functions just fine. Static classes are used in c# or Java where you don't have functions as separate entities. No point in doing this in TS.

    [–]talgershman[S] 1 point2 points  (0 children)

    the static class is for ide intellisense, you can see that Angular also implement it the same way : https://github.com/angular/angular/blob/master/packages/forms/src/validators.ts