Cadre is rethinking decades-old practices in the real estate industry. Phone calls, paper documents, and a hike to the bank don’t keep you from investing in the stock market, and they shouldn’t keep you from investing in alternative assets, either.
So it’s only fitting that while moving a legal document signing process online, we were slowed down by a concept as old as the GUI itself: the form. Displaying a few simple inputs is easy, but wiring up several dozen, each with complex validation and conditional display logic? That’s when we outgrew even our well-encapsulated React components.
Of course, we’re not the first team to ask a lot of the humblecomponent.
Here are a some other ways we use union types on our site:
Fast follow questions
An address that can be the same as a previous one
It’s readily apparent that the tcomb ecosystem ( tcomb, tcomb-validation, and tcomb-form ) is well designed from its basic building blocks (runtime types) to its user-facing conclusions (e.g. conditional forms). Using a union type to drive a conditional form is just one example of the many good ideas in these libraries.
This firm foundation is also what makes tcomb-builder, our immutable builder syntax for tcomb, possible. While the syntax in these examples comes from tcomb-builder, vanilla tcomb and tcomb-form could have been used instead. Our team just found that using immutable builders results in more maintainable code than vanilla tcomb-form’s mutable JSON blobs. Ultimately, everything “compiles” (in the simplest sense of the word) to tcomb and React.
And that, in the end, is its magic. Tcomb asks you to buy theory rather than configuration. It gives you building blocks rather than prefabricated components. How you use it and what you build is up to you.
Cadre is building the world’s first digital stock market for alternative assets. Interested in joining our team and solving challenges like these? Check out our Careers site.
The views expressed above are presented only for informational and educational purposes and are not necessarily the views of Cadre or any of its affiliates. Cadre makes no representations, express or implied, regarding the accuracy or completeness of this information, and the reader accepts all risks in relying on the above information for any purpose whatsoever. This post is not intended to provide, and should not be relied upon for investment, accounting, legal or tax advice. Additionally, this post is not an offer to sell or the solicitation of an offer to buy any securities or other instruments.