Our great sponsors
-
react-prime
Discontinued A starter kit to create comprehensive React apps with React-Query and Styled-Components.
-
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.
Yep, this is my answer too - I use this pattern pretty often. For example, here's the main object that represents the TypeScript Playground at runtime: https://github.com/microsoft/TypeScript-website/blob/86901a0520855050b16b0c23bd6923212fdd0c9c/packages/playground/src/index.ts#L622-L623
Depends on the type. Anything local I do in a types.ts file in the same folder as where I will use the type. Anything "global" I import/export from a single file and when you want to use any of these types you can import them like so. Makes it really easy to use and see what types are available and which are meant to be global.