import { ShaderCanvasContainer } from "https://deno.land/x/shader_canvas@v1.1.1/core/shader_canvas/shader_canvas_container.ts";
This class is meant to be used as an extension.
It represents a container of custom tags. Each child name will be used to register a custom element of type T.
This means that a container can have infinite children, provided that each child has a unique name.
A container is a creator of tags. Each child will be a new tag. This anti-pattern has a set of cool properties, the most used in shader canvas is that it allows the contents of each child to be referenced by the tag name it has.
Example:
Then the contents can be referenced by its child name. This makes it clearer to read and maintain in big HTML trees (the tag collapses). It is also easy to process through the provided DOM access methods.
This class implements the "CanMerge" class, which is an instance of HTMLElement and allows modules to be used in it (their payloads can be merged here).
Properties
This Map associates each new tag child name with its T class instance.
This is helpful when accessing or referencing within a container function.
It avoids querying the DOM.