Our great sponsors
-
This pattern gives us a more functional approach to error handling, gives us strongly typed errors, and works really, really nicely when used in combination with React hooks. Let’s take a look at a simple React example using some infrastructure from AndcultureCode.JavaScript.Core, AndcultureCode.JavaScript.React and AndcultureCode.JavaScript.React.Components:
-
TypeScript is a great language. TypeScript takes JavaScript and makes it actually good. If there’s one glaring weakness, it’s the inability to use strongly typed catch blocks. However, this is mostly due to a design flaw in the JavaScript language; in JavaScript, you can throw anything, not just Error types.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
immutable-js
Immutable persistent data collections for Javascript which increase efficiency and simplicity.
Let’s consider an example using some utilities from AndcultureCode.JavaScript.Core and AndcultureCode.JavaScript.React, which wrap up API responses and errors in ResultRecord and ResultErrorRecord Immutable.js Record types.