Dynamic-loading module

The DOM manipulation project described in the DOM manipulation re-engineered with modules subsection allows several different implementations of the ItemList<T> interface. With module imports, one may select just one of them, but it would be smarter to select the more appropriate implementation at runtime depending on the features supported by the browser and on other JavaScript libraries available in the JavaScript environment. Unluckily, import statements must be placed in the file header, and the string containing the module to import must be static, so the imported module can't depend on any runtime check. At runtime import, statements are processed by loaders/bundlers before any JavaScript module code is executed ...

Get Hands-On TypeScript for C# and .NET Core Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.